From 315d1af7be3c136dcef2a62fd634f6720d5346a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 24 Feb 2025 10:08:17 +0100 Subject: [PATCH 1/4] Applied Icons reference feedback --- .../content_twig_functions.md | 13 +++++++ ...twig_filters.md => icon_twig_functions.md} | 32 ++++++------------ .../img/icons/business-deal-cash.svg.png | Bin 339 -> 1706 bytes .../twig_function_reference.md | 2 +- mkdocs.yml | 2 +- plugins.yml | 3 +- 6 files changed, 27 insertions(+), 25 deletions(-) rename docs/templating/twig_function_reference/{other_twig_filters.md => icon_twig_functions.md} (98%) diff --git a/docs/templating/twig_function_reference/content_twig_functions.md b/docs/templating/twig_function_reference/content_twig_functions.md index 6b634d2bf5..25b6a1eab4 100644 --- a/docs/templating/twig_function_reference/content_twig_functions.md +++ b/docs/templating/twig_function_reference/content_twig_functions.md @@ -106,6 +106,19 @@ If the content item doesn't have a translation in the prioritized or passed lang {% endif %} ``` +### `ibexa_taxonomy_entries_for_content()` filter + +`ibexa_taxonomy_entries_for_content()` fetches names of content categories. + +| Argument | Type | Description | +|---------------|------|-------------| +| `content` | [`Ibexa\Contracts\Core\Repository\Values\Content\Content`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) | Content item to display the category name for. | + +```html+twig +{{ content|ibexa_taxonomy_entries_for_content|map(entry => "#{entry.name}")|join(', ') }} +``` + + ## Non-content related queries ### `ibexa_render_content_query()` diff --git a/docs/templating/twig_function_reference/other_twig_filters.md b/docs/templating/twig_function_reference/icon_twig_functions.md similarity index 98% rename from docs/templating/twig_function_reference/other_twig_filters.md rename to docs/templating/twig_function_reference/icon_twig_functions.md index 530fda51e6..50ceb5d052 100644 --- a/docs/templating/twig_function_reference/other_twig_filters.md +++ b/docs/templating/twig_function_reference/icon_twig_functions.md @@ -2,7 +2,7 @@ page_type: reference --- -# Other Twig filters +# Icon Twig functions ### `ibexa_icon_path()` @@ -53,16 +53,16 @@ To change the default size, in the template add the modifier to the class name. The list of available icon sizes: -|Size| Modifier| +|Modifier|Size| |----|---------| -|`8px`|`--tiny`| -|`12px`|`--tiny-small`| -|`16px`|`--small`| -|`20px`|`--small-medium`| -|`24px`|`--medium`| -|`38px`|`--medium-large`| -|`48px`|`--large`| -|`64px`|`--extra-large`| +|`--tiny`|`8px`| +|`--tiny-small`|`12px`| +|`--small`|`16px`| +|`--small-medium`|`20px`| +|`--medium`|`24px`| +|`--medium-large`|`38px`| +|`--large`|`48px`| +|`--extra-large`|`64px`| #### Icons reference @@ -395,15 +395,3 @@ The following icons are available out-of-the-box: | ![interface-block](img/icons/interface-block.svg.png) | `interface-block` | | ![full-view](img/icons/full-view.svg.png) | `full-view` | | ![un-full-view](img/icons/un-full-view.svg.png) | `un-full-view` | - -### `ibexa_taxonomy_entries_for_content()` - -`ibexa_taxonomy_entries_for_content()` fetches names of content categories. - -| Argument | Type | Description | -|---------------|------|-------------| -| `content` | `Ibexa\Contracts\Core\Repository\Values\Content\Content` | Content item to display the category name for. | - -```html+twig -{{ content|ibexa_taxonomy_entries_for_content|map(entry => "#{entry.name}")|join(', ') }} -``` diff --git a/docs/templating/twig_function_reference/img/icons/business-deal-cash.svg.png b/docs/templating/twig_function_reference/img/icons/business-deal-cash.svg.png index 75c84fd8bc0dd3269ed86927979afd811fb0d315..bc5558ca98b566336daa7ac35c20cb01f046ff0f 100644 GIT binary patch literal 1706 zcmeAS@N?(olHy`uVBq!ia0vp^@<6P>!3-qt#sn9GILRJCz6=aiY77hwEes65fIyp?)FKYVVoZ9^GHrU9Hi!9?XZmNpZ*OQa zRG8?&>UP%NYQfjp)-r2NXI;K>=|o}0hb5c-^j^O)RcFY)*nk*Xzz; zTbB(>)t_fXUyFJlF0x~bY@}L%(UUJKGw0@=5|e!O_GKjC7jmw5WRvcF^!HfU5d z%iZ#Do^tVs%Ec~+c_(C;U+8Qs{K$Fjh{}se;h#CB7v7)Z#1wS7;Y$w#V`>`X&DpII z!cSBbjm#%(KgtxH^JMi@aV8e23)gBEIPe5MG)u6SKd`!-!P@i8_V-L>llhh2YcPF# zBl`EdWuwxfN0To3tW2&bsqwL7{ymec&u4r5*+$$z_yZ24-I*;uk}^XlEd|Fm`=b(vn3@M^1D{5xm=IXnK{`q#IGartMj(^nlIt!KP$ z+_8R-VMy4k)%W5QLQ7O9|4|D#XE#seu+h%#fA%)YyM! zzh{xFx3+Bk`A9Wx?=z2&Zrt7Xn-%}%u2`MDF}KQd@%g&r7k_(J6rGUomT%}k<{!1f zF1+wh6IWZ=))xJ1~O|KV}E&E}<*{C^hy zQT>wlpZ8B8hjHTLi$6YluXN)66TiT5!GA{8^Ka^9Gw(71)23>PYeY#(Vo9o1a#1Rf zVlXl=GSxLO(ls&+F*LO@w6rod*ETS)GBDVm#yK5DLvDUbW?Cg~4d<*kY6CTBz-=hW d%uOvWNz5(4t!Jj*gfBon44$rjF6*2UngAS7ChY(K delta 188 zcmZ3*dzop1gd__y0|SG^nteq;iY49A*O7r?V?XzwMAnIldQ1#*69eUCfHFeTMi+n- zXGxG>FarY4O#`TL4O79bo6`&?bFj&X8W@Ebnp&BdSs7Vq8yHv_82r##B{kWSO-2zz Urn69J8PISBPgg&ebxsLQ04t9z9{>OV diff --git a/docs/templating/twig_function_reference/twig_function_reference.md b/docs/templating/twig_function_reference/twig_function_reference.md index 652946f5a5..fa8ef890fa 100644 --- a/docs/templating/twig_function_reference/twig_function_reference.md +++ b/docs/templating/twig_function_reference/twig_function_reference.md @@ -16,9 +16,9 @@ In addition to the [native functions provided by Twig](https://twig.symfony.com/ "templating/twig_function_reference/product_twig_functions", "templating/twig_function_reference/site_context_twig_functions", "templating/twig_function_reference/storefront_twig_functions", + "templating/twig_function_reference/icon_twig_functions", "templating/twig_function_reference/image_twig_functions", "templating/twig_function_reference/url_twig_functions", "templating/twig_function_reference/date_twig_filters", "templating/twig_function_reference/ai_actions_twig_functions", - "templating/twig_function_reference/other_twig_filters", ], columns=4) =]] diff --git a/mkdocs.yml b/mkdocs.yml index 2ebe44e732..90d3fe3e94 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -293,6 +293,7 @@ nav: - Content Twig functions: templating/twig_function_reference/content_twig_functions.md - Date Twig filters: templating/twig_function_reference/date_twig_filters.md - Field Twig functions: templating/twig_function_reference/field_twig_functions.md + - Icon Twig functions: templating/twig_function_reference/icon_twig_functions.md - Image Twig functions: templating/twig_function_reference/image_twig_functions.md - Product Twig functions: templating/twig_function_reference/product_twig_functions.md - Site context Twig functions: templating/twig_function_reference/site_context_twig_functions.md @@ -300,7 +301,6 @@ nav: - URL Twig functions: templating/twig_function_reference/url_twig_functions.md - User Twig functions: templating/twig_function_reference/user_twig_functions.md - AI Twig functions: templating/twig_function_reference/ai_actions_twig_functions.md - - Other Twig filters: templating/twig_function_reference/other_twig_filters.md - URLs and routes: - URLs and routes: templating/urls_and_routes/urls_and_routes.md - Custom breadcrumbs: templating/urls_and_routes/custom_breadcrumbs.md diff --git a/plugins.yml b/plugins.yml index 80e8b7c507..94275d4060 100644 --- a/plugins.yml +++ b/plugins.yml @@ -190,7 +190,7 @@ plugins: 'guide/content_rendering/twig_function_reference/image_twig_functions.md': 'templating/twig_function_reference/image_twig_functions.md' 'guide/content_rendering/twig_function_reference/url_twig_functions.md': 'templating/twig_function_reference/url_twig_functions.md' 'guide/content_rendering/twig_function_reference/date_twig_filters.md': 'templating/twig_function_reference/date_twig_filters.md' - 'guide/content_rendering/twig_function_reference/other_twig_filters.md': 'templating/twig_function_reference/other_twig_filters.md' + 'guide/content_rendering/twig_function_reference/other_twig_filters.md': 'templating/twig_function_reference/icon_twig_functions.md' 'guide/content_rendering/urls_and_routes.md': 'templating/urls_and_routes/urls_and_routes.md' 'guide/content_rendering/custom_breadcrumbs.md': 'templating/urls_and_routes/custom_breadcrumbs.md' 'guide/content_rendering/design_engine/design_engine.md': 'templating/design_engine/design_engine.md' @@ -531,6 +531,7 @@ plugins: 'getting_started/install_ez_platform.md': 'getting_started/install_ibexa_dxp.md' 'templating/layout/create_user_registration_form.md': 'customer_management/create_user_registration_form.md' + 'templating/twig_function_reference/other_twig_filters.md': 'templating/twig_function_reference/icon_twig_functions.md' 'tutorials/platform_beginner/building_a_bicycle_route_tracker_in_ez_platform.md': 'tutorials/beginner_tutorial/beginner_tutorial.md' 'tutorials/platform_beginner/1_get_ready.md': 'tutorials/beginner_tutorial/1_get_ready.md' From f3c0bc68462e66ab3d81199fae2d71bac7facafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 24 Feb 2025 10:19:06 +0100 Subject: [PATCH 2/4] Fixed links --- .../back_office/back_office_elements/custom_icons.md | 2 +- .../twig_function_reference/content_twig_functions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/administration/back_office/back_office_elements/custom_icons.md b/docs/administration/back_office/back_office_elements/custom_icons.md index 574bb31b97..eb78058973 100644 --- a/docs/administration/back_office/back_office_elements/custom_icons.md +++ b/docs/administration/back_office/back_office_elements/custom_icons.md @@ -25,7 +25,7 @@ Place the icon in `public/assets/images` and run `yarn encore ` after If you want to configure icons per SiteAccess, see [Icon sets](#icon-sets). -To see more configuration options, see [icon sizes](other_twig_filters.md). +To see more configuration options, see [the icon reference](icon_twig_functions.md). ### Access icons in Twig templates diff --git a/docs/templating/twig_function_reference/content_twig_functions.md b/docs/templating/twig_function_reference/content_twig_functions.md index 25b6a1eab4..170ff3230f 100644 --- a/docs/templating/twig_function_reference/content_twig_functions.md +++ b/docs/templating/twig_function_reference/content_twig_functions.md @@ -112,7 +112,7 @@ If the content item doesn't have a translation in the prioritized or passed lang | Argument | Type | Description | |---------------|------|-------------| -| `content` | [`Ibexa\Contracts\Core\Repository\Values\Content\Content`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) | Content item to display the category name for. | +| `content` | [`Ibexa\Contracts\Core\Repository\Values\Content\Content`](../../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) | Content item to display the category name for. | ```html+twig {{ content|ibexa_taxonomy_entries_for_content|map(entry => "#{entry.name}")|join(', ') }} From d17981b29dbfe07e40c40193f34abaa8ab811a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 24 Feb 2025 10:22:52 +0100 Subject: [PATCH 3/4] Fixed links2 --- .../twig_function_reference/content_twig_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/templating/twig_function_reference/content_twig_functions.md b/docs/templating/twig_function_reference/content_twig_functions.md index 170ff3230f..72d640fa4e 100644 --- a/docs/templating/twig_function_reference/content_twig_functions.md +++ b/docs/templating/twig_function_reference/content_twig_functions.md @@ -112,7 +112,7 @@ If the content item doesn't have a translation in the prioritized or passed lang | Argument | Type | Description | |---------------|------|-------------| -| `content` | [`Ibexa\Contracts\Core\Repository\Values\Content\Content`](../../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) | Content item to display the category name for. | +| `content` | [`Ibexa\Contracts\Core\Repository\Values\Content\Content`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) | Content item to display the category name for. | ```html+twig {{ content|ibexa_taxonomy_entries_for_content|map(entry => "#{entry.name}")|join(', ') }} From b8fd121ffa0c5cda72bd7e3fd677d858db9e82ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 24 Feb 2025 10:42:20 +0100 Subject: [PATCH 4/4] Added description --- docs/templating/twig_function_reference/icon_twig_functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/templating/twig_function_reference/icon_twig_functions.md b/docs/templating/twig_function_reference/icon_twig_functions.md index 50ceb5d052..9bf2302985 100644 --- a/docs/templating/twig_function_reference/icon_twig_functions.md +++ b/docs/templating/twig_function_reference/icon_twig_functions.md @@ -1,4 +1,5 @@ --- +description: Icon Twig functions enable referencing SVG icons in templates. page_type: reference ---