Skip to content

Commit

Permalink
[TASK] Overhaul HMENU root line page (#1177)
Browse files Browse the repository at this point in the history
* [TASK] Overhaul HMENU root line page

* Use confvals
* Correct indentation
* Overhaul example

releases: main, 12.4, 11.5

* [TASK] Overhaul HMENU root line page

* Use confvals
* Correct indentation
* Overhaul example

releases: main, 12.4, 11.5

* [TASK] Adjustments from review

* Update Documentation/ContentObjects/Hmenu/Rootline.rst

---------

Co-authored-by: Chris Müller <[email protected]>
  • Loading branch information
linawolf and brotkrueml authored Apr 4, 2024
1 parent 99de54c commit 2578096
Showing 1 changed file with 66 additions and 68 deletions.
134 changes: 66 additions & 68 deletions Documentation/ContentObjects/Hmenu/Rootline.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. include:: /Includes.rst.txt
.. index:: HMENU; special = rootline
.. _hmenu-special-rootline:
.. include:: /Includes.rst.txt
.. index:: HMENU; special = rootline
.. _hmenu-special-rootline:

==========================
Rootline - breadcrumb menu
Expand All @@ -9,11 +9,11 @@ Rootline - breadcrumb menu
The path of pages from the current page to the root page of the page
tree is called "rootline".

A rootline menu is a menu which shows you these pages one by one in
A root line menu is a menu which shows you these pages one by one in
their hierarchical order.

An :typoscript:`HMENU` with the property :typoscript:`special = rootline` creates
a rootline menu (also known as "breadcrumb trail") that could look like this:
a root line menu (also known as "breadcrumb trail") that could look like this:

.. code-block:: none
Expand All @@ -26,95 +26,93 @@ and makes navigation to a certain page level easier.
:ref:`Mount points <t3coreapi:MountPoints>` are supported.


.. contents::
:local:
.. contents::
:local:

.. _hmenu-special-rootline-properties:

Properties
==========

.. _hmenu-special-rootline-range:
.. ### BEGIN~OF~TABLE ###
.. _hmenu-special-rootline-range:

.. container:: table-row
special.range
-------------

Property
special.range
.. confval:: special.range
:name: hmenu-rootline-special-range
:type: string /:ref:`stdWrap <stdwrap>`
:Syntax: `[begin-level] | [end-level]`

Data type
string /:ref:`stdWrap <stdwrap>`
`[begin-level] | [end-level]` are interpreted like the
:ref:`.entryLevel <hmenu-entrylevel>` for an `HMENU`).

Description
[begin-level] \| [end-level] (same way as you reference the
:ref:`.entryLevel <hmenu-entrylevel>` for an HMENU). The following
example will start at level 1 and does not show the page the user is
currently on:
.. _hmenu-special-rootline-range-example:

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
Example: Skip the current page
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

temp.breadcrumbs = HMENU
temp.breadcrumbs.special = rootline
temp.breadcrumbs.special.range = 1|-2
The following
example will start at level 1 and does not show the page the user is
currently on:

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
.. _hmenu-special-rootline-reverseorder:
temp.breadcrumbs = HMENU
temp.breadcrumbs.special = rootline
temp.breadcrumbs.special.range = 1|-2
.. container:: table-row
Property
special.reverseOrder
.. _hmenu-special-rootline-reverseorder:

Data type
boolean
special.reverseOrder
--------------------

Default
0 (false)
.. confval:: special.reverseOrder
:name: hmenu-rootline-special-reverseOrder
:type: boolean
:Default: `false`

Description
If set to true, the order of the rootline menu elements will be
reversed.
If set to true, the order of the root line menu elements will be
reversed.


.. _hmenu-special-rootline-targets:
.. _hmenu-special-rootline-targets:

.. container:: table-row
special.targets.[level number]
------------------------------

Property
special.targets.[level number]
.. confval:: special.targets.[level number]
:name: hmenu-rootline-special-targets
:type: boolean
:Default: `false`

Data type
string
For framesets. You can set a default target and a target for each
level by using the level number as sub-property.

Description
For framesets. You can set a default target and a target for each
level by using the level number as sub-property.
.. _hmenu-special-rootline-targets-example:

**Example:**
Example: Set targets for levels
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here the links to pages on level 3 will have :html:`target="page"`, while
all other levels will have :html:`target="_top"` as defined for the
:ref:`TMENU <tmenu>` property :ref:`menu-common-properties-target`.
Here the links to pages on level 3 will have :html:`target="page"`, while
all other levels will have :html:`target="_top"` as defined for the
:ref:`TMENU <tmenu>` property :ref:`menu-common-properties-target`.

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
page.2 = HMENU
page.2.special = rootline
page.2.special.range = 1|-2
page.2.special.targets.3 = page
page.2.1 = TMENU
page.2.1.target = _top
page.2.1.wrap = <ol> | <ol>
page.2.1.NO.linkWrap = <li> | </li>
page.2 = HMENU
page.2.special = rootline
page.2.special.range = 1|-2
page.2.special.targets.3 = page
page.2.1 = TMENU
page.2.1.target = _top
page.2.1.wrap = <ol> | <ol>
page.2.1.NO.linkWrap = <li> | </li>
.. ###### END~OF~TABLE ######
[tsref:(cObject).HMENU.special = rootline]


.. _hmenu-special-rootline-examples:
.. _hmenu-special-rootline-examples:

Examples
=========
Expand All @@ -125,15 +123,15 @@ Breadcrumb styled with Fluid
The following breadcrumb menu is created with the
:ref:`MenuProcessor <MenuProcessor>`, based on the HMENU. It is styled via Fluid:

.. include:: /CodeSnippets/Menu/TypoScript/BreadcrumbDataProcessor.rst.txt
.. include:: /CodeSnippets/Menu/TypoScript/BreadcrumbDataProcessor.rst.txt

The following Fluid partial can be used to style the breadcrumb menu:

.. include:: /CodeSnippets/Menu/Template/BreadcrumbDataProcessor.rst.txt
.. include:: /CodeSnippets/Menu/Template/BreadcrumbDataProcessor.rst.txt

Breadcrumb with pure TypoScript
--------------------------------

The following breadcrumb menu is styled with pure Typoscript:

.. include:: /CodeSnippets/Menu/TypoScript/BreadcrumbLib.rst.txt
.. include:: /CodeSnippets/Menu/TypoScript/BreadcrumbLib.rst.txt

0 comments on commit 2578096

Please sign in to comment.