Skip to content

Commit

Permalink
[TASK] Document typo3-site-settings directive (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf authored Sep 1, 2024
1 parent a3c0a88 commit b594596
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Configuration/Sets/MySet/settings.definitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
settings:
website.background.color:
label: 'Background color'
description: 'This will validate the given color string'
type: color
default: '#129845'

website.image.lazyLoading:
default: lazy
label: 'Browser-native image lazy loading'
type: string
enum:
lazy: 'Lazy'
eager: 'Eager'
auto: 'Auto'
description: 'Can be "lazy" (browsers could choose to load images later), "eager" (load images right away) or "auto" (browser will determine whether the image should be lazy loaded or not)'

website.rte.allowTags:
default: 'a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, figure, font, footer, header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, s, samp, sdfield, section, small, span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var'
label: 'List of allowed HTML tags when rendering RTE content'
type: string
description: ''
23 changes: 23 additions & 0 deletions Documentation/Reference/ReStructuredText/Code/SiteSettings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. include:: /Includes.rst.txt
.. _reference-site-settings:

=============
Site settings
=============

When an extension features :ref:`Settings definitions <t3coreapi:site-sets-settings-definition>`
for site settings these can be automatically documented by including the settings
definition file. The special syntax `PROJECT:` can be used to load the file
from the directory of the extension instead of the `Documentation` folder only.

.. literalinclude:: _siteSetSettings.rst.txt
:language: rst
:caption: Settings.rst

.. include:: _siteSetSettings.rst.txt

The custom parameters `:type:`, `:Label:` etc can be used to configure
which aspects of the settings should be shown in the overview table.

A `:name:` can be used to create a namespace when there are several sets. All
links to the configuration values will be prefixed then.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. typo3:site-set-settings:: PROJECT:/Configuration/Sets/MySet/settings.definitions.yaml
:name: my-set
:type:
:Label: max=30
:default: max=10
2 changes: 1 addition & 1 deletion Documentation/guides.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
edit-on-github="TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument"
report-issue="https://github.com/TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument/issues/new/choose"
interlink-shortcode="h2document"
typo3-core-preferred="stable"
typo3-core-preferred="main"
/>
<project title="Writing Documentation" release="main" version="main"
copyright="since 2017 by the TYPO3 contributors"/>
Expand Down

0 comments on commit b594596

Please sign in to comment.