Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/templating/twig_function_reference/page_twig_functions.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down