From fec9bb65dc7a7cef1801f1e2ca8d555a4150889d Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Thu, 19 Sep 2024 13:47:35 +0200 Subject: [PATCH] [FEATURE] Make confvals searchable --- .../Confval/ConfvalTrees.rst | 7 + Documentation-rendertest/guides.xml | 1 + .../template/body/directive/confval.html.twig | 4 + .../Typo3DocsThemeExtension.php | 1 + .../src/Nodes/ConfvalMenuNode.php | 6 + .../confval/confval-basic/expected/index.html | 4 +- .../expected/anotherDomain.html | 4 +- .../expected/index.html | 4 +- .../expected/anotherDomain.html | 4 +- .../confval-duplicate/expected/index.html | 4 +- .../expected/index.html | 16 +- .../expected/index.html | 28 ++- .../confval-menu-tree/expected/index.html | 59 +++--- .../expected/anotherDomain.html | 4 +- .../confval-noindex/expected/index.html | 4 +- .../site-set-ext-syntax/expected/index.html | 182 +++++++---------- .../expected/index.html | 185 +++++++----------- .../tests/site-set-labels/expected/index.html | 185 +++++++----------- .../tests/site-set/expected/index.html | 185 +++++++----------- 19 files changed, 395 insertions(+), 492 deletions(-) diff --git a/Documentation-rendertest/Confval/ConfvalTrees.rst b/Documentation-rendertest/Confval/ConfvalTrees.rst index 844c8d904..500891d52 100644 --- a/Documentation-rendertest/Confval/ConfvalTrees.rst +++ b/Documentation-rendertest/Confval/ConfvalTrees.rst @@ -16,6 +16,7 @@ Properties of CASE .. confval:: array of cObjects :name: case-array :type: cObject + :searchFacet: TypoScript Array of cObjects. Use this to define cObjects for the different values of `cobj-case-key`. If `cobj-case-key` has a certain value, @@ -25,12 +26,14 @@ Properties of CASE .. confval:: cache :name: case-cache :type: cache + :searchFacet: TypoScript See for details. .. confval:: default :name: case-default :type: cObject + :searchFacet: TypoScript Use this to define the rendering for *those* values of cobj-case-key that do *not* match any of the values of the cobj-case-array-of-cObjects. If no @@ -40,6 +43,7 @@ Properties of CASE .. confval:: if :name: case-if :type: ->if + :searchFacet: TypoScript If if returns false, nothing is returned. @@ -55,6 +59,7 @@ Properties of COA .. confval:: 1,2,3,4... :name: coa-array :type: cObject + :searchFacet: TCA Numbered properties to define the different cObjects, which should be rendered. @@ -62,12 +67,14 @@ Properties of COA .. confval:: cache :name: coa-cache :type: cache + :searchFacet: TCA See cache function description for details. .. confval:: if :name: coa-if :type: ->if + :searchFacet: TCA If `if` returns false, the COA is **not** rendered. diff --git a/Documentation-rendertest/guides.xml b/Documentation-rendertest/guides.xml index 238388760..a43c444f4 100644 --- a/Documentation-rendertest/guides.xml +++ b/Documentation-rendertest/guides.xml @@ -5,6 +5,7 @@ links-are-relative="true">
@@ -35,9 +36,11 @@ {% endif -%} {%- for key, option in node.additionalOptions -%} + {%- if not key in ['searchFacet', 'searchKeywords'] %}
{{ key }}
{{ renderNode(option) }}
+ {% endif -%} {% endfor -%}
{% endif %} @@ -46,3 +49,4 @@ + diff --git a/packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php b/packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php index 7088e98b4..34f2707c7 100644 --- a/packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php +++ b/packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php @@ -65,6 +65,7 @@ public function load(array $configs, ContainerBuilder $container): void 'project_issues' => $this->getConfigValue($configs, 'project_issues', ''), 'report_issue' => $this->getConfigValue($configs, 'report_issue', ''), 'typo3_core_preferred' => $this->getConfigValue($configs, 'typo3_core_preferred', ''), + 'confval_default' => $this->getConfigValue($configs, 'confval_default', 'Option'), ], ], ); diff --git a/packages/typo3-docs-theme/src/Nodes/ConfvalMenuNode.php b/packages/typo3-docs-theme/src/Nodes/ConfvalMenuNode.php index c7a2aea85..e9ae43c51 100644 --- a/packages/typo3-docs-theme/src/Nodes/ConfvalMenuNode.php +++ b/packages/typo3-docs-theme/src/Nodes/ConfvalMenuNode.php @@ -33,6 +33,7 @@ public function __construct( private readonly bool $excludeNoindex = false, private readonly array $exclude = [], private readonly bool $noindex = false, + private readonly string $facet = 'Option', ) { parent::__construct('confval-menu', $plainContent, $content, $value); } @@ -112,4 +113,9 @@ public function isNoindex(): bool { return $this->noindex; } + + public function getFacet(): string + { + return $this->facet; + } } diff --git a/tests/Integration/tests/confval/confval-basic/expected/index.html b/tests/Integration/tests/confval/confval-basic/expected/index.html index cf37b2727..d0afd2e20 100644 --- a/tests/Integration/tests/confval/confval-basic/expected/index.html +++ b/tests/Integration/tests/confval/confval-basic/expected/index.html @@ -1,7 +1,8 @@

Confval

-
+
+
demo @@ -25,6 +26,7 @@

Confval

+

See also demo.

diff --git a/tests/Integration/tests/confval/confval-duplicate-with-name/expected/anotherDomain.html b/tests/Integration/tests/confval/confval-duplicate-with-name/expected/anotherDomain.html index 4c8077e33..b2f4be57a 100644 --- a/tests/Integration/tests/confval/confval-duplicate-with-name/expected/anotherDomain.html +++ b/tests/Integration/tests/confval/confval-duplicate-with-name/expected/anotherDomain.html @@ -1,7 +1,8 @@

Confval in another domain

-
+
+
demo @@ -25,5 +26,6 @@

Confval in another domain

Confval

-
+
+
demo @@ -25,6 +26,7 @@

Confval

+

See also demo and the config value in the other domain: demo.

diff --git a/tests/Integration/tests/confval/confval-duplicate/expected/anotherDomain.html b/tests/Integration/tests/confval/confval-duplicate/expected/anotherDomain.html index 8168bba23..3a67e68f3 100644 --- a/tests/Integration/tests/confval/confval-duplicate/expected/anotherDomain.html +++ b/tests/Integration/tests/confval/confval-duplicate/expected/anotherDomain.html @@ -1,7 +1,8 @@

Confval in another domain

-
+
+
demo @@ -25,5 +26,6 @@

Confval in another domain

Confval

-
+
+
demo @@ -25,6 +26,7 @@

Confval

+

See also demo.

diff --git a/tests/Integration/tests/confval/confval-menu-tree-anchor/expected/index.html b/tests/Integration/tests/confval/confval-menu-tree-anchor/expected/index.html index 086f9943c..ca7dfc7e1 100644 --- a/tests/Integration/tests/confval/confval-menu-tree-anchor/expected/index.html +++ b/tests/Integration/tests/confval/confval-menu-tree-anchor/expected/index.html @@ -45,7 +45,8 @@

Confval

-
+
+
array of cObjects @@ -69,8 +70,10 @@

Confval

+
-
+
+
cache @@ -91,8 +94,10 @@

Confval

+
-
+
+
default @@ -116,9 +121,11 @@

Confval

+
Conditions
-
+
+
if @@ -139,6 +146,7 @@

Confval

+
diff --git a/tests/Integration/tests/confval/confval-menu-tree-multiple/expected/index.html b/tests/Integration/tests/confval/confval-menu-tree-multiple/expected/index.html index 75d785858..ed8158807 100644 --- a/tests/Integration/tests/confval/confval-menu-tree-multiple/expected/index.html +++ b/tests/Integration/tests/confval/confval-menu-tree-multiple/expected/index.html @@ -49,7 +49,8 @@

Properties of CASE

-
+
+
-
+
+
+
-
+
+
+
-
+
+
+
+
@@ -179,7 +187,8 @@

Properties of COA -
+
+
-
+
+
+
-
+
+
+
+

diff --git a/tests/Integration/tests/confval/confval-menu-tree/expected/index.html b/tests/Integration/tests/confval/confval-menu-tree/expected/index.html index 3d8bc12c7..5a897bf0f 100644 --- a/tests/Integration/tests/confval/confval-menu-tree/expected/index.html +++ b/tests/Integration/tests/confval/confval-menu-tree/expected/index.html @@ -652,7 +652,8 @@

Confval menu as table

Confvals

-
+
+
demo 1 @@ -668,9 +669,6 @@

ConfvalsDefault

"Hello World"
-
Level
-
1 -
-
+
+
+
"Hello World"
-
Level
-
1 -

+
+
+
"Hello World"
-
Level
-
3 -
-
+
+
+
"Hello World"
-
Level
-
2 -
-
+ +
+
"Hello World"
-
Level
-
1 -
-
+ +
+
"Hello World"
-
Level
-
1 -
-
+ +
+
"Hello World"
-
Level
-
1 -
+ diff --git a/tests/Integration/tests/confval/confval-noindex/expected/anotherDomain.html b/tests/Integration/tests/confval/confval-noindex/expected/anotherDomain.html index 8168bba23..3a67e68f3 100644 --- a/tests/Integration/tests/confval/confval-noindex/expected/anotherDomain.html +++ b/tests/Integration/tests/confval/confval-noindex/expected/anotherDomain.html @@ -1,7 +1,8 @@

Confval in another domain

-
+
+
demo @@ -25,5 +26,6 @@

Confval in another domain

Confval

-
+
+
demo @@ -25,6 +26,7 @@

Confval

+

See also demo.

diff --git a/tests/Integration/tests/site-set-ext-syntax/expected/index.html b/tests/Integration/tests/site-set-ext-syntax/expected/index.html index 2e395f17e..738a862b4 100644 --- a/tests/Integration/tests/site-set-ext-syntax/expected/index.html +++ b/tests/Integration/tests/site-set-ext-syntax/expected/index.html @@ -354,7 +354,8 @@

Site Set Configuration

-
+
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/Integration/tests/site-set-labels-autoload/expected/index.html b/tests/Integration/tests/site-set-labels-autoload/expected/index.html index 0b067deb0..270e36b74 100644 --- a/tests/Integration/tests/site-set-labels-autoload/expected/index.html +++ b/tests/Integration/tests/site-set-labels-autoload/expected/index.html @@ -368,7 +368,8 @@

Site Set Configuration -
+
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
+ diff --git a/tests/Integration/tests/site-set-labels/expected/index.html b/tests/Integration/tests/site-set-labels/expected/index.html index 0b067deb0..270e36b74 100644 --- a/tests/Integration/tests/site-set-labels/expected/index.html +++ b/tests/Integration/tests/site-set-labels/expected/index.html @@ -368,7 +368,8 @@

Site Set Configuration -
+
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
+ diff --git a/tests/Integration/tests/site-set/expected/index.html b/tests/Integration/tests/site-set/expected/index.html index 0b067deb0..270e36b74 100644 --- a/tests/Integration/tests/site-set/expected/index.html +++ b/tests/Integration/tests/site-set/expected/index.html @@ -368,7 +368,8 @@

Site Set Configuration -
+
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
-
+ +
+
+