Skip to content

Commit

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

* Use confvals
* Correct indentation
* Overhaul example

releases: main, 12.4, 11.5

* [TASK] Overhaul HMENU Language page

* Use confvals
* Correct indentation
* Overhaul example

releases: main, 12.4, 11.5
  • Loading branch information
linawolf authored Apr 3, 2024
1 parent 831d609 commit be77d4f
Showing 1 changed file with 108 additions and 162 deletions.
270 changes: 108 additions & 162 deletions Documentation/ContentObjects/Hmenu/Keywords.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. include:: /Includes.rst.txt
.. index:: HMENU; special = keywords
.. _hmenu-special-keywords:
.. include:: /Includes.rst.txt
.. index:: HMENU; special = keywords
.. _hmenu-special-keywords:

=================================
Keywords - menu of related pages
Expand All @@ -11,150 +11,128 @@ on the current page.

Mount pages are supported.

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

.. _hmenu-special-keywords-properties:

Properties
==========

.. _hmenu-special-keywords-value:
.. _hmenu-special-keywords-value:

special.value
-------------

.. ### BEGIN~OF~TABLE ###
.. container:: table-row

Property
special.value
.. confval:: special.value
:name: hmenu-keywords-special-value
:type: integer /:ref:`stdWrap <stdwrap>`

Data type
integer /:ref:`stdWrap <stdwrap>`
UID of the page for which related pages by keyword should be found.

Description
Page for which keywords to find similar pages
.. _hmenu-special-keywords-value-example:

**Example:**
Example: Find related pages of the current page
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.relatedPagesMenu = HMENU
lib.relatedPagesMenu {
special = keywords
special {
value.data = TSFE:id
entryLevel = 1
mode = manual
}
// render the menu
}
lib.relatedPagesMenu = HMENU
lib.relatedPagesMenu {
special = keywords
special {
value.data = TSFE:id
entryLevel = 1
mode = manual
}
// render the menu
}
.. _hmenu-special-keywords-mode:
.. _hmenu-special-keywords-mode:

special.mode
-------------

.. container:: table-row
.. confval:: special.mode
:name: hmenu-keywords-special-mode
:type: string
:Default: `SYS_LASTCHANGED`

Property
special.mode
Which field in the :sql:`pages` table should be used for sorting?

Data type
string
Possible values are:

Default
SYS\_LASTCHANGED
`SYS_LASTCHANGED`
Is updated to the youngest time stamp of the
records on the page when a page is generated.

Description
Which field in the pages table to use for sorting.

Possible values are:

SYS\_LASTCHANGED:
Is updated to the youngest tstamp of the
records on the page when a page is generated.

manual or lastUpdated:
Uses the field "lastUpdated", which
can be set manually in the page-record.
`manual` or `lastUpdated`
Uses the field :sql:`lastUpdated`, which
can be set manually in the page record.

tstamp:
Uses the "tstamp"-field of the pagerecord, which is set
automatically when the record is changed.
`tstamp`
Uses the :sql:`tstamp` field of the page record, which is set
automatically when the record is changed.

crdate:
Uses the "crdate"-field of the pagerecord.
`crdate`
Uses the :sql:`crdate` field of the page record. This field is set
once on creation of the record and left unchanged afterwards.

starttime:
Uses the starttime field.
`starttime`
Uses the :sql:`starttime` field.


.. _hmenu-special-keywords-entrylevel:
.. _hmenu-special-keywords-entrylevel:

special.entryLevel
-------------------

.. container:: table-row

Property
special.entryLevel

Data type
integer
.. confval:: special.entryLevel
:name: hmenu-keywords-special-entryLevel
:type: integer

Description
Where in the rootline the search begins.
Where in the root line the search begins.

See property :ref:`entryLevel in the HMENU <hmenu-entrylevel>`.
See property :ref:`entryLevel in the HMENU <hmenu-entrylevel>`.

.. _hmenu-special-keywords-depth:
.. _hmenu-special-keywords-depth:

special.depth
--------------

.. container:: table-row

Property
special.depth

Data type
integer

Default
20
.. confval:: special.depth
:name: hmenu-keywords-special-depth
:type: integer
:Default: 20

Description
(same as in section "special = updated")
Same as in section :ref:`"special = updated" <hmenu-special-updated-depth>`.


.. _hmenu-special-keywords-limit:
.. _hmenu-special-keywords-limit:

special.limit
--------------

.. container:: table-row
.. confval:: special.limit
:name: hmenu-keywords-special-limit
:type: integer
:Default: 10

Property
special.limit

Data type
integer
Maximal number of items in the menu. Default is 10, maximum is 100.

Default
10

Description
(same as in section "special = updated")


.. _hmenu-special-keywords-excludenosearchpages:
.. _hmenu-special-keywords-excludenosearchpages:

special.excludeNoSearchPages
-----------------------------

.. container:: table-row
.. confval:: special.excludeNoSearchPages
:name: hmenu-keywords-special-excludeNoSearchPages
:type: boolean
:Default: false

.. container:: table-row

Property
special.excludeNoSearchPages
Expand All @@ -163,105 +141,73 @@ special.excludeNoSearchPages
boolean

Description
(same as in section "special = updated")
If set, pages marked `No search` are not included.

.. _hmenu-special-keywords-begin:
.. _hmenu-special-keywords-begin:

special.begin
--------------

.. container:: table-row
.. confval:: special.begin
:name: hmenu-keywords-special-begin
:type: boolean

Property
special.begin

Data type
boolean
.. TODO: What does this do?
Description
(same as in section "special = updated")

.. _hmenu-special-keywords-setkeywords:
.. _hmenu-special-keywords-setkeywords:

special.setKeywords
--------------------

.. container:: table-row
.. confval:: special.setKeywords
:name: hmenu-keywords-special-setKeywords
:type: string /:ref:`stdWrap <stdwrap>`

Property
special.setKeywords
Lets you define the keywords manually by defining them as a comma-
separated list. If this property is defined, it overrides the default,
which is the keywords of the current page.

Data type
string /:ref:`stdWrap <stdwrap>`

Description
Lets you define the keywords manually by defining them as a comma-
separated list. If this property is defined, it overrides the default,
which is the keywords of the current page.

.. _hmenu-special-keywords-keywordsfield:
.. _hmenu-special-keywords-keywordsfield:

special.keywordsField
----------------------

.. container:: table-row
.. confval:: special.keywordsField
:name: hmenu-keywords-special-keywordsField
:type: string
:Default: `keywords`

Property
special.keywordsField
Defines the field in the :sql:`pages` table in which to search for the
keywords. Default is the field name :sql:`keyword`. No check is done to see
if the field you enter here exists, so make sure to enter an existing field.

Data type
string

Default
keywords

Description
Defines the field in the pages table in which to search for the
keywords. Default is the field name "keyword". No check is done to see
if the field you enter here exists, so make sure to enter an existing field!


.. _hmenu-special-keywords-sourcefield:
.. _hmenu-special-keywords-sourcefield:

special.keywordsField.sourceField
----------------------------------

.. container:: table-row

Property
special.keywordsField.sourceField

Data type
string

Default
keywords

Description
Defines the field from the current page from which to take the
keywords being matched. The default is "keyword". (Notice that
".keywordsField" is only setting the page-record field to *search
in*!)

.. confval:: special.keywordsField.sourceField
:name: hmenu-keywords-special-setKeywords-sourceField
:type: string
:Default: `keywords`

Defines the field from the current page from which to take the
keywords being matched. The default is :sql:`keyword`. (Notice that
:confval:`hmenu-keywords-special-setKeywords` is only setting the
page record field to *search in*!)

.. ###### END~OF~TABLE ######
.. _hmenu-special-keywords-examples:

[tsref:(cObject).HMENU.special = keywords]

Example
=======

Menu of related pages
----------------------
Example: Menu of related pages
==============================

The content element :guilabel:`Menu > Related pages` provided by the system
Extension EXT:fluid_styled_content is configured with a :php:`MenuProcessor`
which is based on the options of the :ref:`HMENU <cobj-hmenu>` and provides
all its properties:

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

The following Fluid template can be used to style the menu:

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

0 comments on commit be77d4f

Please sign in to comment.