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

[TASK] Fix description of additionalCanonicalizedUrlParameters #5153

Merged
merged 6 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
================================================
linawolf marked this conversation as resolved.
Show resolved Hide resolved

.. 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.
garvinhicking marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -449,7 +449,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
Loading