Skip to content

Commit 3d916ce

Browse files
authored
IBX-7187: Get content category Twig filter (#2251)
1 parent 12836e7 commit 3d916ce

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/templating/twig_function_reference/other_twig_filters.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ by accessing the `content` property:
3434
</svg>
3535
```
3636

37-
### Icons size variants
37+
#### Icon size variants
3838

3939
The default icon size in the Back Office is `32px`. To change the default size, in the template add the modifier to the class name.
4040

@@ -56,3 +56,15 @@ The list of available icon sizes:
5656
|`38px`|`--medium-large`|
5757
|`48px`|`--large`|
5858
|`64px`|`--extra-large`|
59+
60+
### `ibexa_taxonomy_entries_for_content()`
61+
62+
`ibexa_taxonomy_entries_for_content()` fetches names of content categories.
63+
64+
| Argument | Type | Description |
65+
|---------------|------|-------------|
66+
| `content` | `Ibexa\Contracts\Core\Repository\Values\Content\Content` | Content item to display the category name for. |
67+
68+
```html+twig
69+
{{ content|ibexa_taxonomy_entries_for_content|map(entry => "#{entry.name}")|join(', ') }}
70+
```

0 commit comments

Comments
 (0)