From 4a142f3f8279c3e256622189a4093be941063b1e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:58:37 +0100 Subject: [PATCH] [Backport 13.4] [TASK] Move content of "Data Types" (#1464) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [TASK] Move content of "Data Types" There are no real data types in TypoScript, there are just certain string formats expected in some properties. Where the former "data type" is an expected input for exactly one function, move the expected input to that function. Where it works like a function itself, move it to functions, Move the rest of expected string formats to the syntax but make clear they are no real types. Releases: main, 13.4 * Apply suggestions from code review Co-authored-by: Stefan Frömken * Update Documentation/Functions/Wrap.rst * Apply suggestions from code review Co-authored-by: Stefan Frömken * Update Documentation/Functions/Wrap.rst --------- Co-authored-by: lina.wolf Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com> Co-authored-by: Stefan Frömken --- .../ContentObjects/Hmenu/Tmenu/Index.rst | 4 +- .../ContentObjects/Hmenu/Tmenu/Tmenuitem.rst | 2 +- Documentation/DataTypes/Index.rst | 565 ------------------ Documentation/Functions/Data.rst | 1 + Documentation/Functions/Imagelinkwrap.rst | 8 +- Documentation/Functions/Imgresource.rst | 55 +- Documentation/Functions/Makelinks.rst | 6 +- Documentation/Functions/Stdwrap.rst | 40 +- Documentation/Functions/Typolink.rst | 6 +- Documentation/Functions/Wrap.rst | 34 ++ Documentation/Gifbuilder/Colors.rst | 33 + Documentation/Gifbuilder/Index.rst | 1 + .../Gifbuilder/ObjectNames/Text/Index.rst | 4 +- Documentation/Index.rst | 1 - Documentation/Syntax/Index.rst | 1 + Documentation/Syntax/StringFormats/Index.rst | 175 ++++++ .../StringFormats}/_FunctionName.php | 0 Documentation/TopLevelObjects/Page/Index.rst | 4 +- 18 files changed, 346 insertions(+), 594 deletions(-) delete mode 100644 Documentation/DataTypes/Index.rst create mode 100644 Documentation/Functions/Wrap.rst create mode 100644 Documentation/Gifbuilder/Colors.rst create mode 100644 Documentation/Syntax/StringFormats/Index.rst rename Documentation/{DataTypes => Syntax/StringFormats}/_FunctionName.php (100%) diff --git a/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst b/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst index 5ada1cf1b..7b3ef8f79 100644 --- a/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst +++ b/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst @@ -40,7 +40,7 @@ These properties are all the item states used by :typoscript:`TMENU`. .. warning:: Be aware to properly escape menu item content in order to prevent - Cross-site scripting vulnerabilities. It is therefore highly recommended + Cross-site scripting vulnerabilities. It is therefore highly recommended to use :php:`stdWrap.htmlSpecialChars = 1` in all TMENU item states. The following Item states are listed from the least to the highest priority: @@ -287,7 +287,7 @@ Properties .. confval:: target :name: menu-common-properties-target - :type: :ref:`data-type-target` + :type: string :Default: self Target of the menu links diff --git a/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst b/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst index cf4398b7b..fe95e5cac 100644 --- a/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst +++ b/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst @@ -193,7 +193,7 @@ Properties .. confval:: altTarget :name: tmenuitem-altTarget - :type: :ref:`data-type-target` + :type: string Alternative target overriding the target property of the ref:`TMENU `, if set. diff --git a/Documentation/DataTypes/Index.rst b/Documentation/DataTypes/Index.rst deleted file mode 100644 index a2cd613e7..000000000 --- a/Documentation/DataTypes/Index.rst +++ /dev/null @@ -1,565 +0,0 @@ -.. include:: /Includes.rst.txt -.. index:: Simple data types -.. _data-types: -.. _data-types-reference: - -================= -Simple data types -================= - -The values assigned to properties in TypoScript are often of a -specific format. These formats are described in this chapter. - -For example, if a value is defined as the type :typoscript:``, HTML code has to be -supplied. If it is of the type :typoscript:`resource`, it's a reference to a file from -the resource-field in the template. If the type is :typoscript:`GraphicColor`, a -color-definition is expected and an HTML color code or comma-separated -RGB-values have to be provided. - -The following is a list of available data types, their usage, purpose and -examples. - -.. contents:: - :local: - -.. index:: Simple data types; align -.. _data-type-align: - -align -===== - -.. confval:: align - :name: data-type-align - :Default: :typoscript:`left` - :Allowed values: :typoscript:`left`, :typoscript:`center`, :typoscript:`right` - - Decides about alignment. - - -.. index:: Simple data types; boolean -.. _data-type-boolean: - -boolean -======= - -.. confval:: boolean - :name: data-type-boolean - - Possible values for boolean variables are `1` and `0` - meaning TRUE and FALSE. - - Everything else is `evaluated to one of these values by PHP`__: - Non-empty strings (except `0` [zero]) are treated as TRUE, - empty strings are evaluated to FALSE. - - __ https://www.php.net/manual/en/language.types.boolean.php - - .. rubric:: Examples - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - dummy.enable = 0 # false, preferred notation - dummy.enable = 1 # true, preferred notation - dummy.enable = # false, because the value is empty - - -.. index:: Simple data types; case -.. _data-type-case: - -case -==== - -.. confval:: case - :name: data-type-case - - Do a case conversion. - - .. rubric:: Possible values: - - ============================= ========================================================== - Value Effect - ============================= ========================================================== - :typoscript:`upper` Convert all letters of the string to upper case - :typoscript:`lower` Convert all letters of the string to lower case - :typoscript:`capitalize` Uppercase the first character of each word in the string - :typoscript:`ucfirst` Convert the first letter of the string to upper case - :typoscript:`lcfirst` Convert the first letter of the string to lower case - :typoscript:`uppercamelcase` Convert underscored `upper_camel_case` to `UpperCamelCase` - :typoscript:`lowercamelcase` Convert underscored `lower_camel_case` to `lowerCamelCase` - ============================= ========================================================== - - .. rubric:: Example - - Code: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - 10 = TEXT - 10.value = Hello world! - 10.case = upper - - Result: - - .. code-block:: text - :caption: Example Output - - HELLO WORLD! - - -.. index:: Simple data types; date-conf -.. _data-type-date-conf: - -date-conf -========= - -.. confval:: date-conf - :name: data-type-date-conf - - Used to format a date, see PHP function :php:`date()`. See the - documentation of `allowed date time formats in - PHP `__. - - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.date-conf = d-m-y - - -.. index:: Simple data types; degree -.. _data-type-degree: - -degree -====== - -.. confval:: degree - :name: data-type-degree - - `-90` to `90`, integers - - Example: `45` - - -.. index:: Simple data types; dir -.. _data-type-dir: - -dir -=== - -.. confval:: dir - :name: data-type-dir - - .. rubric:: Syntax - - [path relative to the web root of the site] \| [list of valid - extensions] \| [sorting: name, size, ext, date] \| [reverse: "r"] \| - [return full path: boolean] - - - Files matching are returned in a comma-separated string. - - .. rubric:: Example - - This example returns a list of all pdf, gif and jpg-files from - :file:`fileadmin/files/` sorted by their name reversely and with the full path (with - :file:`fileadmin/files/` prepended): - - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.dir = fileadmin/files/ | pdf,gif,jpg | name | r | true - - -.. index:: Simple data types; function name -.. _data-type-function-name: - -function name -============= - -.. confval:: function name - :name: data-type-function-name - - Indicates a function or method in a class to call. See more information at - the :ref:`USER cObject `. - - If no namespaces are used, then the class or function name, but not the method - name, should probably be prefixed with :php:`user_`. The prefix can be - changed in the :php:`$GLOBALS['TYPO3_CONF_VARS']` config though. The function - / method is normally called with 2 parameters, :php:`$conf` which is the - TypoScript configuration and :php:`$content`, some content to be processed and - returned. - - .. todo: Which entry in TYPO3_CONF_VARS enables the user-prefix to be changed? This - should be mentioned. Looks like this entry has gone and this info no - longer valid. - - If no namespaces are used and if a method in a class is called, it is checked (when using the - :typoscript:`USER`/:typoscript:`USER_INT` objects) whether a class with the same name, but - prefixed with :php:`ux_` is present and if so, *this* class is instantiated - instead. See the document "Inside TYPO3" for more information on extending - classes in TYPO3! - - .. todo: Where is this feature mentioned? We should add a reference here. - - .. rubric:: Examples - - Method in namespaced class. This is the preferred version: - - .. code-block:: typoscript - - lib.someThing = USER_INT - lib.someThing.userFunc = MyVendor\MyExtension\SomeNamespace\SomeClass->someFunction - - .. literalinclude:: _FunctionName.php - :language: php - :caption: EXT:my_extension/Classes/SomeNamespace/SomeClass.php - - Single Function: - - .. code-block:: text - - user_reverseString - - Method in class without namespace: - - .. code-block:: text - - user_yourClass->reverseString - - -.. index:: Simple data types; getText -.. _data-type-function-getText: - -getText -======= - -The getText data type is some kind of tool box allowing to retrieve -values from a variety of sources. Read more: :ref:`data-type-gettext` - - -.. index:: Simple data types; GraphicColor -.. _data-type-GraphicColor: - -GraphicColor -============ - -.. confval:: GraphicColor - :name: data-type-GraphicColor - - .. rubric:: Syntax: - - [colordef] : [modifier] - - Where modifier can be an integer which is added or subtracted to the three - RGB-channels or a floating point with an :typoscript:`*` before, which will then - multiply the values with that factor. - - - The color can be given as HTML-color or as a comma-separated list of - RGB-values (integers). An extra parameter can be given, that will modify the - color mathematically: - - .. rubric:: Examples - - * :typoscript:`red` (HTML color) - * :typoscript:`#ffeecc` (HTML color as hexadecimal notation) - * :typoscript:`255,0,255` (HTML color as decimal notation) - - *Extra:* - - * :typoscript:`red : *0.8` ("red" is darkened by factor 0.8) - * :typoscript:`#ffeecc : +16` ("ffeecc" is going to #fffedc because 16 is added) - - -.. index:: Simple data types; imageExtension -.. _data-type-imageExtension: - -imageExtension -============== - -.. confval:: imageExtension - :name: data-type-imageExtension - - Image extensions can be anything among the allowed types defined in the - global variable :php:`$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']`. - Standard is pdf, gif, jpg, jpeg, tif, bmp, ai, pcx, tga, png. - - The value **"web"** is special. This will ensure that an image is - converted to a web image format (gif or jpg) if it happens not to be already! - - .. rubric:: Examples - - jpg - - web *(gif or jpg ..)* - - -.. index:: Simple data types; imgResource -.. _data-type-imgResource: - -imgResource -=========== - -.. todo: This seems to be a duplicate of Documentation/Functions/Imgresource.rst? - -.. confval:: imgResource - :name: data-type-imgResource - - #. A :confval:`data-type-resource` plus imgResource properties. - - Filetypes can be anything among the allowed types defined in the - configuration variable - :php:`$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']`. Standard is - pdf, gif, jpg, jpeg, tif, bmp, ai, pcx, tga, png. - - #. A GIFBUILDER object. See the object reference for :ref:`gifbuilder`. - - .. rubric:: Examples - - Here "file" is an imgResource: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - 10 = IMAGE - 10 { - file = fileadmin/toplogo.gif - file.width = 200 - } - - GIFBUILDER: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - 10 = IMAGE - 10.file = GIFBUILDER - 10.file { - # GIFBUILDER properties here... - } - - -.. index:: Simple data types; integer -.. _data-type-integer: - -integer -======= - -.. confval:: integer - :name: data-type-integer - - .. rubric:: Examples - - 42, -8, -9, 0 - - - This data type is sometimes used generally though another type would have - been more appropriate, like :ref:`pixels `. - - -.. index:: Simple data types; path -.. _data-type-path: - -path -==== - -.. confval:: path - :name: data-type-path - - - Path relative to the root directory from which we operate. - Also resolves `EXT:` syntax. - - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.settings.somePath = fileadmin/stuff/ - - -.. index:: Simple data types; pixels -.. _data-type-pixels: - -pixels -====== - -.. confval:: pixels - :name: data-type-pixels - - pixel-distance - - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.someWidth = 345 - - -.. index:: Simple data types; positive integer -.. _data-type-positive-integer: - -positive integer -================ - -.. confval:: positive integer - :name: data-type-positive-integer - - - Positive :confval:`data-type-integer`. - - .. rubric:: Examples - - 42, 8, 9 - - -.. index:: Simple data types; resource -.. _data-type-resource: - -resource -======== - -.. confval:: resource - :name: data-type-resource - - If the value contains a "/", it is expected to be a reference (absolute or - relative) to a file in the file system. There is no support for wildcard - characters in the name of the reference. - - .. rubric:: Example - - Reference to a file in the file system: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.settings.someFile = fileadmin/picture.gif - -.. index:: Simple data types; strftime-conf -.. _data-type-strftime-conf: - -strftime-conf -============= - -.. confval:: strftime-conf - :name: data-type-strftime-conf - - See function `strftime on php.net `__. - - -.. index:: Simple data types; string -.. _data-type-string: - -string -====== - -.. confval:: string - :name: data-type-string - - Sometimes used generally though another type would have been more - appropriate, like "align". - - .. rubric:: Example - - The quick brown fox jumps over the lazy dog. - - -.. index:: Simple data types; tag -.. _data-type-tag: - -tag -=== - -.. confval:: tag - :name: data-type-tag - - An HTML tag. - - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.settings.bodyTag = - - -.. index:: Simple data types; tag-params -.. _data-type-tag-params: - -tag-params -========== - -.. confval:: tag-params - :name: data-type-tag-params - - Parameters for a tag. - - .. rubric:: Examples - - For -params: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.settings.someParams = border="0" framespacing="0" - - -.. index:: Simple data types; target -.. _data-type-target: - -target -====== - -.. confval:: target - :name: data-type-target - - .. rubric:: Examples - - :typoscript:`_top`, :typoscript:`_blank`, :typoscript:`content` - - - Target in an :html:``-tag. - - This is normally the same value as the name of the root-level object - that defines the frame. - - -.. index:: Simple data types; wrap -.. _data-type-wrap: - -wrap -==== - -.. confval:: wrap - :name: data-type-wrap - - :Syntax: <...> \| - - - Used to wrap something. The vertical bar ("|") is the place, where - your content will be inserted; the parts on the left and right of the - vertical line are placed on the left and right side of the content. - - Spaces between the wrap-parts and the divider ("|") are trimmed off - from each part of the wrap. - - If you want to use more sophisticated data functions, then you - should use `stdWrap.dataWrap` instead of `wrap`. - - A `wrap` is processed and rendered as the last of the other components of - a cObject. - - .. rubric:: Examples - - This will cause the value to be wrapped in a p-tag coloring the - value red: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10.stdWrap.wrap =

|

diff --git a/Documentation/Functions/Data.rst b/Documentation/Functions/Data.rst index 4e5f92d82..27ad97ac2 100644 --- a/Documentation/Functions/Data.rst +++ b/Documentation/Functions/Data.rst @@ -1,5 +1,6 @@ .. include:: /Includes.rst.txt .. index:: Function; getText +.. _data-type-function-getText: .. _data-type-gettext: ============== diff --git a/Documentation/Functions/Imagelinkwrap.rst b/Documentation/Functions/Imagelinkwrap.rst index be8630cc5..38bec9505 100644 --- a/Documentation/Functions/Imagelinkwrap.rst +++ b/Documentation/Functions/Imagelinkwrap.rst @@ -143,7 +143,7 @@ bodyTag .. confval:: imageLinkWrap.bodyTag :name: imagelinkwrap-bodyTag - :type: :ref:`data-type-tag` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` This is the ``-tag of the preview window. Needs :typoscript:`JSwindow = 1`. @@ -181,7 +181,7 @@ target .. confval:: imageLinkWrap.target :name: imagelinkwrap-target - :type: :ref:`data-type-target` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` :Default: :typoscript:`thePicture` This specifies the `target` attribute of the link. The attribute @@ -243,10 +243,10 @@ JSwindow.newWindow :type: :ref:`data-type-boolean` / :ref:`stdwrap` :Default: 0 - If the :ref:`Doctype ` allows the :ref:`data-type-target` + If the :ref:`Doctype ` allows the string attribute then the image will be opened in a window with the name given by `target`. If that windows is kept open and the next image with the - same :ref:`data-type-target` attribute is to be shown then it will appear + same string attribute is to be shown then it will appear in the same preview window. If :typoscript:`JSwindow.newWindow` is set to True, then a unique hash value is used as `target` value for each image. diff --git a/Documentation/Functions/Imgresource.rst b/Documentation/Functions/Imgresource.rst index 2c115a404..9ae994afd 100644 --- a/Documentation/Functions/Imgresource.rst +++ b/Documentation/Functions/Imgresource.rst @@ -2,14 +2,48 @@ .. index:: Functions; imgResource imgResource +.. _data-type-imgResource: .. _imgresource: =========== imgResource =========== -imgResource contains the properties that are used with the data type -imgResource. +An imgResource one of the following: + +#. A :confval:`data-type-resource` plus imgResource properties. + + Filetypes can be anything among the allowed types defined in the + configuration variable + :php:`$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']`. Standard is + gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,webp. + +#. A GIFBUILDER object. See the object reference for :ref:`gifbuilder`. + +.. rubric:: Examples + +Here "file" is an imgResource: + +.. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + 10 = IMAGE + 10 { + file = fileadmin/toplogo.gif + file.width = 200 + } + +GIFBUILDER: + +.. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + 10 = IMAGE + 10.file = GIFBUILDER + 10.file { + # GIFBUILDER properties here... + } + .. contents:: :local: @@ -20,6 +54,7 @@ imgResource. Properties ========== +.. _data-type-imageExtension: .. _imgresource-ext: ext @@ -27,7 +62,7 @@ ext .. confval:: ext :name: imgresource-ext - :type: :ref:`data-type-imageExtension` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` :Default: web Target file extension for the processed image. The value :typoscript:`web` checks if @@ -37,6 +72,8 @@ ext :php:`$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']` in the install tool. + Standard is gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,webp. + .. _imgresource-width: @@ -45,7 +82,7 @@ width .. confval:: width :name: imgresource-width - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` If both the width and the height are set and one of the numbers is appended by an :typoscript:`m`, the proportions will be preserved and thus @@ -107,7 +144,7 @@ height .. confval:: height :name: imgresource-height - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` See :ref:`imgresource-width`. @@ -315,7 +352,7 @@ maxW .. confval:: maxW :name: imgresource-maxW - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` Maximum width @@ -327,7 +364,7 @@ maxH .. confval:: maxH :name: imgresource-maxH - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` Maximum height @@ -339,7 +376,7 @@ minW .. confval:: minW :name: imgresource-minW - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` Minimum width (overrules maxW/maxH) @@ -351,7 +388,7 @@ minH .. confval:: minH :name: imgresource-minH - :type: :ref:`data-type-pixels` / :ref:`stdwrap` + :type: integer / :ref:`stdwrap` Minimum height (overrules maxW/maxH) diff --git a/Documentation/Functions/Makelinks.rst b/Documentation/Functions/Makelinks.rst index a2da999b1..fc8b22c52 100644 --- a/Documentation/Functions/Makelinks.rst +++ b/Documentation/Functions/Makelinks.rst @@ -49,7 +49,7 @@ http.extTarget .. confval:: http.extTarget :name: makelinks-http-extTarget - :type: :ref:`data-type-target` + :type: string :Default: \_top The target of the link. @@ -111,7 +111,7 @@ http.ATagParams .. confval:: http.ATagParams :name: makelinks-http-ATagParams - :type: :ref:`data-type-tag-params` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` Additional parameters @@ -167,7 +167,7 @@ mailto.ATagParams .. confval:: mailto.ATagParams :name: makelinks-mailto.ATagParams - :type: :ref:`data-type-tag-params` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` Additional parameters diff --git a/Documentation/Functions/Stdwrap.rst b/Documentation/Functions/Stdwrap.rst index daf1e6502..895671263 100644 --- a/Documentation/Functions/Stdwrap.rst +++ b/Documentation/Functions/Stdwrap.rst @@ -830,6 +830,7 @@ strtotime } +.. _data-type-strftime-conf: .. _stdwrap-strftime: strftime @@ -996,6 +997,7 @@ age lib.ageFormat.stdWrap.age = " Minuten | Stunden | Tage | Jahre | Minute | Stunde | Tag | Jahr" +.. _data-type-case: .. _stdwrap-case: case @@ -1003,12 +1005,44 @@ case .. confval:: case :name: stdwrap-case - :type: :ref:`data-type-case` / :ref:`stdWrap` + :type: string / :ref:`stdWrap` Converts case Uses "UTF-8" for the operation. + .. rubric:: Possible values: + + ============================= ========================================================== + Value Effect + ============================= ========================================================== + :typoscript:`upper` Convert all letters of the string to upper case + :typoscript:`lower` Convert all letters of the string to lower case + :typoscript:`capitalize` Uppercase the first character of each word in the string + :typoscript:`ucfirst` Convert the first letter of the string to upper case + :typoscript:`lcfirst` Convert the first letter of the string to lower case + :typoscript:`uppercamelcase` Convert underscored `upper_camel_case` to `UpperCamelCase` + :typoscript:`lowercamelcase` Convert underscored `lower_camel_case` to `lowerCamelCase` + ============================= ========================================================== + + .. rubric:: Example + + Code: + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + 10 = TEXT + 10.value = Hello world! + 10.case = upper + + Result: + + .. code-block:: text + :caption: Example Output + + HELLO WORLD! + .. _stdwrap-bytes: @@ -1437,6 +1471,7 @@ postCObject :ref:`stdwrap-cObject` appended the content. +.. _data-type-align: .. _stdwrap-wrapAlign: wrapAlign @@ -1444,7 +1479,8 @@ wrapAlign .. confval:: wrapAlign :name: stdwrap-wrapAlign - :type: :ref:`data-type-align` / :ref:`stdWrap` + :type: string / :ref:`stdWrap` + :Allowed values: :typoscript:`left`, :typoscript:`center`, :typoscript:`right` Wraps content with :typoscript:`
|
` *if* align is set. diff --git a/Documentation/Functions/Typolink.rst b/Documentation/Functions/Typolink.rst index 5de231912..254369e78 100644 --- a/Documentation/Functions/Typolink.rst +++ b/Documentation/Functions/Typolink.rst @@ -35,7 +35,7 @@ extTarget .. confval:: extTarget :name: typolink-extTarget - :type: :ref:`data-type-target` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` :Default: "" (no target set) Target used for external links @@ -48,7 +48,7 @@ fileTarget .. confval:: fileTarget :name: typolink-fileTarget - :type: :ref:`data-type-target` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` Target used for file links @@ -87,7 +87,7 @@ target .. confval:: target :name: typolink-target - :type: :ref:`data-type-target` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` Target used for internal links diff --git a/Documentation/Functions/Wrap.rst b/Documentation/Functions/Wrap.rst new file mode 100644 index 000000000..36f49c4c3 --- /dev/null +++ b/Documentation/Functions/Wrap.rst @@ -0,0 +1,34 @@ +.. include:: /Includes.rst.txt +.. _data-type-wrap: + +==== +Wrap +==== + +.. confval:: wrap + :name: data-type-wrap + + :Syntax: <...> \| + + Used to wrap something. The vertical bar ("|") is the place, where + your content will be inserted; the parts on the left and right of the + vertical line are placed on the left and right side of the content. + + Spaces between the wrap-parts and the divider ("|") are trimmed off + from each part of the wrap. + + If you want to use more sophisticated data functions, then you + should use `stdWrap.dataWrap` instead of `wrap`. + + A `wrap` is applied as one of the last of properties + a cObject. + + .. rubric:: Examples + + This will cause the value to be wrapped in a p-tag coloring the + value red: + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.wrap =

|

diff --git a/Documentation/Gifbuilder/Colors.rst b/Documentation/Gifbuilder/Colors.rst new file mode 100644 index 000000000..2f4b34bb7 --- /dev/null +++ b/Documentation/Gifbuilder/Colors.rst @@ -0,0 +1,33 @@ +.. include:: /Includes.rst.txt +.. index:: GIFBUILDER; +calc +.. _gifbuilder-colors: + +=============================== +Colors in TypoScript GIFBUILDER +=============================== + +.. _data-type-GraphicColor: +.. confval:: GraphicColor + :name: data-type-GraphicColor + + .. rubric:: Syntax: + + [colordef] : [modifier] + + Where modifier can be an integer which is added or subtracted to the three + RGB-channels or a floating point with an :typoscript:`*` before, which will then + multiply the values with that factor. + The color can be given as HTML-color or as a comma-separated list of + RGB-values (integers). An extra parameter can be given, that will modify the + color mathematically: + + .. rubric:: Examples + + * :typoscript:`red` (HTML color) + * :typoscript:`#ffeecc` (HTML color as hexadecimal notation) + * :typoscript:`255,0,255` (HTML color as decimal notation) + + *Extra:* + + * :typoscript:`red : *0.8` ("red" is darkened by factor 0.8) + * :typoscript:`#ffeecc : +16` ("ffeecc" is going to #fffedc because 16 is added) diff --git a/Documentation/Gifbuilder/Index.rst b/Documentation/Gifbuilder/Index.rst index 378b0b0ec..f295457e3 100644 --- a/Documentation/Gifbuilder/Index.rst +++ b/Documentation/Gifbuilder/Index.rst @@ -27,6 +27,7 @@ supported file format. PNG and JPG can be created as well today (configured with :glob: Examples + Colors Calc Properties ObjectNames/Index diff --git a/Documentation/Gifbuilder/ObjectNames/Text/Index.rst b/Documentation/Gifbuilder/ObjectNames/Text/Index.rst index 7229aafe2..a4be1b184 100644 --- a/Documentation/Gifbuilder/ObjectNames/Text/Index.rst +++ b/Documentation/Gifbuilder/ObjectNames/Text/Index.rst @@ -35,7 +35,7 @@ align * :typoscript:`center` * :typoscript:`right` - +.. _data-type-degree: .. _gifbuilder-text-angle: angle @@ -43,7 +43,7 @@ angle .. confval:: angle :name: gifbuilder-text-angle - :type: :ref:`data-type-degree` + :type: integer :Default: 0 :Range: -90 to 90 diff --git a/Documentation/Index.rst b/Documentation/Index.rst index 8c3b3e973..356931afc 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -56,7 +56,6 @@ chapter. DataProcessing/Index TopLevelObjects/Index Functions/Index - DataTypes/Index Conditions/Index .. toctree:: diff --git a/Documentation/Syntax/Index.rst b/Documentation/Syntax/Index.rst index 682290f54..dac51bc16 100644 --- a/Documentation/Syntax/Index.rst +++ b/Documentation/Syntax/Index.rst @@ -20,3 +20,4 @@ store configuration in this structure. Comments/Index Conditions/Index FileImports/Index + StringFormats/Index diff --git a/Documentation/Syntax/StringFormats/Index.rst b/Documentation/Syntax/StringFormats/Index.rst new file mode 100644 index 000000000..7e0d3af9b --- /dev/null +++ b/Documentation/Syntax/StringFormats/Index.rst @@ -0,0 +1,175 @@ +:navigation-title: String formats +.. include:: /Includes.rst.txt +.. _data-types: +.. _data-types-reference: +.. _string-formats: + +========================= +TypoScript string formats +========================= + +The values assigned to properties in TypoScript are internally handled as +strings. + +Some properties expect a certain format of string. These formats are described +in this chapter. + +Enforcing these string formats is up to the implementation of the property using +them. They are therefore no real constructs of the TypoScript syntax. + +.. contents:: + :local: + +.. index:: Simple data types; boolean +.. _data-type-boolean: + +boolean +======= + +.. confval:: boolean + :name: data-type-boolean + + Possible values for boolean variables are `1` and `0` + meaning TRUE and FALSE. + + Everything else is `evaluated to one of these values by PHP`__: + Non-empty strings (except `0` [zero]) are treated as TRUE, + empty strings are evaluated to FALSE. + + __ https://www.php.net/manual/en/language.types.boolean.php + + .. rubric:: Examples + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + dummy.enable = 0 # false, preferred notation + dummy.enable = 1 # true, preferred notation + dummy.enable = # false, because the value is empty + +.. index:: Simple data types; date-conf +.. _data-type-date-conf: + +date-conf +========= + +.. confval:: date-conf + :name: data-type-date-conf + + Used to format a date, see PHP function :php:`date()`. See the + documentation of `allowed date time formats in + PHP `__. + + .. rubric:: Example + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.date-conf = d-m-y + + +.. index:: Simple data types; function name +.. _data-type-function-name: + +function name +============= + +.. confval:: function name + :name: data-type-function-name + + Indicates a function or method in a class to call. See more information at + the :ref:`USER cObject `. + + .. rubric:: Examples + + Method name in a namespaced class: + + .. code-block:: typoscript + + lib.someThing = USER_INT + lib.someThing.userFunc = MyVendor\MyExtension\SomeNamespace\SomeClass->someFunction + + .. literalinclude:: _FunctionName.php + :language: php + :caption: EXT:my_extension/Classes/SomeNamespace/SomeClass.php + +.. index:: Simple data types; integer +.. _data-type-positive-integer: +.. _data-type-integer: + +integer +======= + +.. confval:: integer + :name: data-type-integer + + .. rubric:: Examples + + 42, -8, -9, 0 + + Positive integers expect to be greater or equal zero. + + +.. index:: Simple data types; path +.. _data-type-path: + +path +==== + +.. confval:: path + :name: data-type-path + + Path relative to the root directory from which we operate. + Also resolves `EXT:` syntax. + + .. rubric:: Example + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.settings.somePath = fileadmin/stuff/ + + +.. index:: Simple data types; resource +.. _data-type-resource: + +resource +======== + +.. confval:: resource + :name: data-type-resource + + If the value contains a "/", it is expected to be a reference (absolute or + relative) to a file in the file system. There is no support for wildcard + characters in the name of the reference. + + .. rubric:: Example + + Reference to a file in the file system: + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.settings.someFile = fileadmin/picture.gif + +.. index:: Simple data types; string +.. _data-type-string: + +string +====== + +.. confval:: string + :name: data-type-string + + Any property in TypoScript is a string technically. String can be defined + in a single line or with multiple lines, using the + :ref:`typoscript-syntax-syntax-multiline-values`. + + .. rubric:: Example + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.value = The quick brown fox jumps over the lazy dog. + + .. include:: /CodeSnippets/TypoScriptSyntax/OperatorUnset.rst.txt diff --git a/Documentation/DataTypes/_FunctionName.php b/Documentation/Syntax/StringFormats/_FunctionName.php similarity index 100% rename from Documentation/DataTypes/_FunctionName.php rename to Documentation/Syntax/StringFormats/_FunctionName.php diff --git a/Documentation/TopLevelObjects/Page/Index.rst b/Documentation/TopLevelObjects/Page/Index.rst index f0c58ac42..718e62224 100644 --- a/Documentation/TopLevelObjects/Page/Index.rst +++ b/Documentation/TopLevelObjects/Page/Index.rst @@ -204,7 +204,7 @@ Properties .. confval:: bodyTag :name: page-bodyTag - :type: :ref:`data-type-tag` + :type: string :Default: `` :Example: :ref:`Set a class on the body tag ` @@ -284,7 +284,7 @@ Properties .. confval:: headTag :name: page-headTag - :type: :ref:`data-type-tag` / :ref:`stdwrap` + :type: string / :ref:`stdwrap` :Default: `` Head-tag if alternatives are wanted