diff --git a/docs/templating/twig_function_reference/page_twig_functions.md b/docs/templating/twig_function_reference/page_twig_functions.md new file mode 100644 index 0000000000..81f7bdd099 --- /dev/null +++ b/docs/templating/twig_function_reference/page_twig_functions.md @@ -0,0 +1,33 @@ +--- +description: Page field and page block Twig functions access to configuration. +page_type: reference +edition: experience +month_change: true +--- + +# Page Twig functions + +## `ibexa_append_cacheable_query_params()` + +Get the query parameters of a page block as [configured in `cacheable_query_params`](page_blocks.md#block-configuration). +If the block type has no configured query parameters, an empty array is returned. + +```twig +{{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', { + 'locationId': locationId, + 'blockId': block.id, + 'versionNo': versionInfo.versionNo, + 'languageCode': field.languageCode +}, ibexa_append_cacheable_query_params(block))) }} +``` + +## `ibexa_page_layout()` + +Get the layout template of a landing page. + +```twig +{% include ibexa_page_layout(page) with {'zones': page.zones} %} +``` + +It can be used to render a [page field](pagefield.md). +For an example, you can look at how the default `vendor/ibexa/fieldtype-page/src/bundle/Resources/views/fields/ibexa_landing_page.html.twig` uses it. diff --git a/docs/templating/twig_function_reference/twig_function_reference.md b/docs/templating/twig_function_reference/twig_function_reference.md index abba7c79b3..c9810c8e80 100644 --- a/docs/templating/twig_function_reference/twig_function_reference.md +++ b/docs/templating/twig_function_reference/twig_function_reference.md @@ -14,6 +14,7 @@ In addition to the [native functions provided by Twig](https://twig.symfony.com/ "templating/twig_function_reference/content_twig_functions", "templating/twig_function_reference/component_twig_functions", "templating/twig_function_reference/field_twig_functions", + "templating/twig_function_reference/page_twig_functions", "templating/twig_function_reference/product_twig_functions", "templating/twig_function_reference/site_context_twig_functions", "templating/twig_function_reference/storefront_twig_functions", diff --git a/mkdocs.yml b/mkdocs.yml index 77a37fda43..0bec2ac49d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -311,6 +311,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 + - Page Twig functions: templating/twig_function_reference/page_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