Skip to main content

Templating

Aktualisiert vor 3 Monaten

../../_images/logo_typotonic3.jpg

Templating

Here is a quick overview of information about templating with the TypoTonic Extension:

ConditionTemplatingInclude Namespace to the fluid template<span class="pre">{namespace</span> <span class="pre">t</span> <span class="pre">=</span> <span class="pre">Aix\Tonic\ViewHelpers}</span>This namespace is auto-registered when the extension is active, *so you don't need to use this line in your templates!*Records are injectedThe default available marker for all records, when having lists is <span class="pre">{records}</span>(Can be configured in the Tonic Constants)A single record is injectedA single record when in single record context, can be called by using the default <span class="pre">{record}</span>(Can be configured in the Tonic Constants)A value for a fieldTo retrieve a value, use <span class="pre">{record.fieldname}</span> (e.g. <span class="pre">{record.myfield}</span>. The values are of different return types. Please refer to your field configuration for more details. The frontend value is processed with the DataMapper. The frontend value is defined in the field setting <span class="pre">Frontend</span> <span class="pre">Type</span> <span class="pre">Definition</span> in the Tab <span class="pre">Frontend</span> <span class="pre">Settings</span>You can also use <span class="pre"><f:debug>{record.fieldname}</f:debug></span> to get debug informationNote

Of course you can use <span class="pre"><f:debug>{_all}</f:debug></span> to find out which variables are available!

Predefining Templates

Templates in the selector can be predefined with the following TypoScript. Please add the TypoScript to your root template.

<span></span><span class="nb">plugin</span><span class="p">.</span>tx_tonic<span class="p">.</span>templates <span class="ss">{</span>
    myTemplateIdentifier <span class="ss">{</span>
      group <span class="o">=</span> General
      icon <span class="o">=</span> <span class="s">EXT:tonic/Resources/Public/Icons/Datatype/brick.png</span>
      name <span class="o">=</span> My Test Template
      file <span class="o">=</span> <span class="s">EXT:tonic_templates/Resources/Private/Templates/tonic_test1.html</span>
    <span class="ss">}</span>
<span class="ss">}</span>

../../_images/screenshot_template_selection.jpg

War diese Seite hilfreich?

Helfen Sie uns dabei, die Dokumentation zu verbessern.

Feedback senden