# Categories and Tags
Source: https://kart.bnomei.com/docs/content/categories-and-tags
Updated: 2025-08-08T14:02:19+00:00
Summary: Learn how to use the Kirby Kart plugin for categories, tags, related products, URL-param filtering, and performance-boosting caching in your Kirby CMS store.
## Categories
Code (php):
```
categories()->sortBy('count', 'desc') as $c) {
/** @var \Bnomei\Kart\Category $c */
?>
= $c ?>
```
- `$category->count()`
- `$category->id()`
- `$category->isActive()`
- `$category->text()`
- `$category->url()`
- `$category->urlWithParams()`
Code (php):
```
productsWithCategory($categories) as $product) {
/** @var ProductPage $product */
?>
= product->title() ?>
```
## Tags
Code (php):
```
tags()->sortBy('count', 'desc') as $t) {
/** @var \Bnomei\Kart\Tag $t */
?>
= $t ?>
```
- `$tag->count()`
- `$tag->id()`
- `$tag->isActive()`
- `$tag->text()`
- `$tag->url()`
- `$tag->urlWithParams()`
Code (php):
```
productsWithTag($tags) as $product) {
/** @var ProductPage $product */
?>
= product->title() ?>
```
## Related products
Code (php):
```
productsRelated($product)->not($product) as $related) {
/** @var ProductPage $related */ ?>
= $related->title() ?>
```
## Products by URL params
Path: http://localhost:8000/products/category:evil/tags:heavy,medium
Code (php):
```
productsByParams() as $product) {
/** @var ProductPage $product */ ?>
= $product->title() ?>
```
## Performance
The Kirby Kart plugin will store the matching products for each combination of categories and tags in caches to improve the lookup performance. These caches will be flushed when any product gets updated via the Panel.