Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 12.4] [TASK] Fix description of additionalCanonicalizedUrlParameters #5158

Merged
merged 6 commits into from
Dec 22, 2024
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: 19 additions & 14 deletions Documentation/ApiOverview/Seo/CanonicalApi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@ cHash.
EXT:seo. You can find information about how to install and use it in the
:doc:`EXT:seo manual <ext_seo:Index>`.

Excluding arguments from the generation
=======================================
.. _canonicalapi-additionalparameters:

TYPO3 will fallback to building a URL of current page and appending query strings.
It is possible to exclude specific arguments from being appended.
This is achieved by adding those arguments to a PHP variable:
Including specific arguments for the URL generation
===================================================

.. code-block:: php
:caption: EXT:site_package/ext_localconf.php
TYPO3 will building a URI of the current page and append query strings
which are needed for the cHash calculation (vital arguments to uniquely identify
the given content URI). This is especially important with for example detail pages of records. The query parameters are crucial to show the right content.

$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'][] = 'example_argument_name';
It is possible to additionally include specific arguments.
This is achieved by adding those arguments to the configuration:

It is possible to exclude nested arguments:
.. code-block:: php
:caption: EXT:site_package/ext_localconf.php

.. code-block:: php
:caption: EXT:site_package/ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'][] = 'example_argument_name';

$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'][] = 'example_argument_name[second_level]';
It is possible to include nested arguments:

Arguments in general should be excluded from cHash as well as ``additionalCanonicalizedUrlParameters``.
See the possible options in :ref:`caching`, regarding excluding arguments from cHash.
.. code-block:: php
:caption: EXT:site_package/ext_localconf.php

$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'][] = 'example_argument_name[second_level]';

Non-vital arguments in general should be excluded from cHash and not be listed as ``additionalCanonicalizedUrlParameters``.
See the possible options in :ref:`caching` regarding excluding arguments from cHash.

The idea behind that is:

Expand Down
3 changes: 2 additions & 1 deletion Documentation/Configuration/Typo3ConfVars/FE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ the TYPO3 frontend:
:type: array
:Default: []

The given parameters will be included when calculating canonicalized URL
The given parameters will be included when calculating canonicalized URL.
See :ref:`canonicalapi-additionalparameters` for details.

.. _typo3ConfVars_fe_cacheHash:

Expand Down