Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c58dab5
About `cacheable_query_params`
adriendupuis Feb 2, 2026
d921f92
About `cacheable_query_params`
adriendupuis Feb 2, 2026
d31ea55
mkdocs.yml + page_twig_functions.md
adriendupuis Feb 2, 2026
a5a41fa
Update docs/content_management/field_types/field_type_reference/pagef…
adriendupuis Feb 2, 2026
f3bffe1
Merge branch 'cacheable-query-params' into page-twig-functions
adriendupuis Feb 2, 2026
c87e743
page_blocks.md: nobr in table
adriendupuis Feb 3, 2026
393f848
pagefield.md: Move example to file
adriendupuis Feb 3, 2026
ed2dd9b
pagefield.md: emphase on ibexa_append_cacheable_query_params optionality
adriendupuis Feb 3, 2026
afb4bf5
pagefield.md: emphase on ibexa_append_cacheable_query_params optionality
adriendupuis Feb 3, 2026
aaf1d09
data-ez-block-id -> data-ibexa-block-id
adriendupuis Feb 3, 2026
11768ad
page_twig_functions.md
adriendupuis Feb 3, 2026
8ae06dc
Merge branch '5.0' into cacheable-query-params
adriendupuis Feb 3, 2026
43cdb7f
Merge branch 'page-twig-functions' into cacheable-query-params
adriendupuis Feb 3, 2026
86cd14c
pagefield.md: Link to page_twig_functions.md
adriendupuis Feb 3, 2026
38085c2
pagefield.md: typo
adriendupuis Feb 3, 2026
4a07410
Apply suggestions from code review
adriendupuis Feb 3, 2026
190f9c5
pagefield.md: Fix style and syntax
adriendupuis Feb 3, 2026
4430edc
page_blocks.md: rewording
adriendupuis Feb 4, 2026
44d42b2
page_blocks.md: rewording+link
adriendupuis Feb 4, 2026
3481d79
Update docs/content_management/field_types/field_type_reference/pagef…
adriendupuis Feb 4, 2026
b76ddba
pagefield.md: Rewording
adriendupuis Feb 4, 2026
d03849f
Merge branch '5.0' into cacheable-query-params
adriendupuis Feb 4, 2026
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
22 changes: 22 additions & 0 deletions code_samples/page/pagefield_layout.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div>
{# The required attribute for the displayed zone #}
<div data-ibexa-zone-id="{{ zones[0].id }}">
{# If a zone with [0] index contains any blocks #}
{% if zones[0].blocks %}
{# for each block #}
{% for block in blocks %}
{# create a new layer with appropriate ID #}
<div class="landing-page__block block_{{ block.type }}" data-ibexa-block-id="{{ block.id }}">
{# render the block by using the "Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction" controller #}
{# location.id is the ID of the Location of the current content item, block.id is the ID of the current block #}
{{ 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))) }}
</div>
{% endfor %}
{% endif %}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

Each div that's a zone should have the `data-ibexa-zone-id` attribute with zone ID as a value for a zone container.

To render a block inside the layout, use the Twig `render_esi()` function to call `Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction`.
To render a block inside the layout, use the Twig [`render_esi()`]([[= symfony_doc =]]/reference/twig_reference.html#render-esi) function to call `Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction`.

Check failure on line 44 in docs/content_management/field_types/field_type_reference/pagefield.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/field_types/field_type_reference/pagefield.md#L44

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/field_types/field_type_reference/pagefield.md", "range": {"start": {"line": 44, "column": 148}}}, "severity": "ERROR"}

The `renderAction` has the following parameters:

Expand All @@ -52,6 +52,10 @@
| `versionNo` | Version number of the content item to render. |
| `languageCode` | Language code of the content item to render. |

If your block needs to be dependent on query parameters like "page" and you already configured your custom block with a [`cacheable_query_params configuration`](page_blocks.md#block-configuration), pass [`ibexa_append_cacheable_query_params(block)`](page_twig_functions.md#ibexa_append_cacheable_query_params) as the third argument to the [`controller()` Twig function]([[= symfony_doc =]]/reference/twig_reference.html#controller) so that the HTTP cache can vary based on those query parameters.

In a fresh installation, the feature is only used by the back office's [Dashboard blocks]([[= user_doc =]]/getting_started/dashboard/dashboard_block_reference/): "My content" and "Review queue".

Example usage:

``` html+twig
Expand All @@ -60,32 +64,11 @@
'blockId': block.id,
'versionNo': versionInfo.versionNo,
'languageCode': field.languageCode
})) }}
}, ibexa_append_cacheable_query_params(block))) }}
```

As a whole a sample layout could look as follows:

``` html+twig
<div>
{# The required attribute for the displayed zone #}
<div data-ibexa-zone-id="{{ zones[0].id }}">
{# If a zone with [0] index contains any blocks #}
{% if zones[0].blocks %}
{# for each block #}
{% for block in blocks %}
{# create a new layer with appropriate ID #}
<div class="landing-page__block block_{{ block.type }}" data-ez-block-id="{{ block.id }}">
{# render the block by using the "Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction" controller #}
{# location.id is the ID of the Location of the current content item, block.id is the ID of the current block #}
{{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', {
'locationId': locationId,
'blockId': block.id,
'versionNo': versionInfo.versionNo,
'languageCode': field.languageCode
})) }}
</div>
{% endfor %}
{% endif %}
</div>
</div>
[[= include_file('code_samples/page/pagefield_layout.html.twig') =]]
```
19 changes: 10 additions & 9 deletions docs/content_management/pages/page_blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ For information on how to create and configure new layouts for the Page, see [Pa

Each configured block has an identifier and the following settings:

| Setting | Description |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name` | Name of the block used in the Page Builder interface. Translatable using the `ibexa_page_fieldtype` translation domain. |
| `category` | Category in the Page Builder **Page blocks** toolbox that the block is shown in. Translatable using the `ibexa_page_fieldtype` translation domain. |
| `thumbnail` | Thumbnail used in the Page Builder **Page blocks** toolbox. |
| `views` | Available [templates for the block](#block-templates). |
| `visible` | (Optional) Toggles the block's visibility in the Page Builder **Page blocks** toolbox. Remove the block from the layout before you publish another version of the page. |
| `configuration_template` | (Optional) Template for the block settings modal. |
| `attributes` | (Optional) List of [block attributes](page_block_attributes.md). |
| Setting | Description |
|---------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name` | Name of the block used in the Page Builder interface. Translatable using the `ibexa_page_fieldtype` translation domain. |
| `category` | Category in the Page Builder **Page blocks** toolbox that the block is shown in. Translatable using the `ibexa_page_fieldtype` translation domain. |
| `thumbnail` | Thumbnail used in the Page Builder **Page blocks** toolbox. |
| `views` | Available [templates for the block](#block-templates). |
| `visible` | (Optional) Toggles the block's visibility in the Page Builder **Page blocks** toolbox. Remove the block from the layout before you publish another version of the page. |
| `configuration_template` | (Optional) Template for the block settings modal. |
| `attributes` | (Optional) List of [block attributes](page_block_attributes.md). |
| <nobr>`cacheable_query_params`</nobr> | (Optional) List of query parameters the block's [ESI HTTP cache](http_cache_configuration.md#when-to-use-esi) varies on.<br>For example, if the block is paginated using `?page=ℕ` from the page URL, add `page` to this list.<br>See [`ibexa_append_cacheable_query_params()`Twig function](page_twig_functions.md#ibexa_append_cacheable_query_params). |

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ You should not use ESI for parts that are effectively uncached, because your rev

!!! note "ESI limitations with the URIElement SiteAccess matcher"

Is isn't possible to share ESIs across the SiteAccesses when using URI matching as URI contains the SiteAccess name encoded in its path information.
It isn't possible to share ESIs across the SiteAccesses when using URI matching as URI contains the SiteAccess name encoded in its path information.
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 provide 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
Loading