Skip to content

Commit

Permalink
[TASK] Describe different approaches for handling of content element …
Browse files Browse the repository at this point in the history
…categories (#750)

- pidInList = root with recursive = 99 doesn't work
  • Loading branch information
oskardydo authored Jul 25, 2024
1 parent 7450e7f commit cff669f
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions Documentation/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ To use JsonRedirect, define it in the setup.yaml of your extension form's setup:
.. image:: ../Images/Configuration/JsonViewModule.png
:alt: JsonView Module icon with label

|

The JsonView module is an experimental approach for previewing JSON responses of a page in different contexts like pageType, page arguments, usergroup, language, and show/hide hidden content.

Expand All @@ -377,7 +376,6 @@ The JsonView module is an experimental approach for previewing JSON responses of
.. image:: ../Images/Configuration/JsonViewModule-example.png
:alt: Root page for the API endpoint

|

**PageTypeModes**

Expand All @@ -389,7 +387,6 @@ By default, there are 3 settings available:
- *initialData* - standard response from pageType=834
- *detailNews* (commented out) - example of calling the detail action of the news extension for test purposes

|

.. code-block:: yaml
Expand All @@ -416,12 +413,39 @@ By default, there are 3 settings available:
# action: detail
# controller: News
# news: 1
|
..
**Custom YAML Configuration**

You can always create your own YAML configuration and set it in the extension configuration.

.. image:: ../Images/Configuration/JsonViewModule-extconf.png
:alt: Root page for the API endpoint

Content element categories
==========================

Headless default configuration for content element categories in TypoScript `lib.contentElement` is to look in root (`page uid=0`). However depending on your project needs this may not ideal.

(as of TYPO3 v12 you cannot use together `pidInList = root` and `recursive = 99`)

Alternative approach for categories may be to use categories from current rootPage which mitigates this problem.

To begin you need to unset previous `pidInList` value

.. code-block:: text
lib.contentElement.fields.categories.10.select.pidInList >
If you need categories from current rootPage

.. code-block:: text
lib.contentElement.fields.categories.10.select.pidInList >
lib.contentElement.fields.categories.10.select.pidInList.data = leveluid : 0
You can add 'recursive' if categories may be stored under current rootPage

.. code-block:: text
lib.contentElement.fields.categories.10.select.pidInList >
lib.contentElement.fields.categories.10.select.pidInList.data = leveluid : 0
lib.contentElement.fields.categories.10.select.recursive = 99

0 comments on commit cff669f

Please sign in to comment.