Fluid Content

Hier das Vorgehen, um eigene Content Elemente zu definieren. Dies sind verschachtelete Container im Bootstrap Raster, Slider, Überschriften etc.

Grundkonfiguration

in ext_tables.php die Content Definitionen der Extension registrieren:

// Register page types
Tx_Flux_Core::registerProviderExtensionKey('rsyslayout_bootstrap', 'Content');

Typoscript Konfiguration

Die Template Pfade werden hier gesetzt. Damit das funktioniert müssen die folgenden Resourcen in das Resources/Private Verzeichniss der Extension kopiert werden:

EXT:flux/Resources/Private/Partials/Flexform/
EXT:fluidcontent/Resources/Private/Layouts/

Dann folgendes Typoscript:

plugin.tx_rsyslayoutbootstrap.view {
    templateRootPath = EXT:rsyslayout_bootstrap/Resources/Private/Templates/
    partialRootPath = EXT:rsyslayout_bootstrap/Resources/Private/Partials/
    layoutRootPath = EXT:rsyslayout_bootstrap/Resources/Private/Layouts/
    extensionKey = rsyslayout_bootstrap
    widget {
        Tx_Fluid_ViewHelpers_Widget_PaginateViewHelper.templateRootPath < plugin.tx_rsyslayoutbootstrap.view.templateRootPath
        TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath < plugin.tx_rsyslayoutbootstrap.view.templateRootPath
    }
}
# Width of grid
plugin.tx_rsyslayoutbootstrap.settings {
        gridColumns = {$plugin.tx_rsyslayoutbootstrap.settings.gridColumns}
}

Templates

Nun den Ordner Resources/Private/Templates/Content anlegen und dort für jeden Content Typ eine Datei. Ich nehme als Beispiel eine sehr einfache:c070_Well.html. Das Präfix c070_ habe ich eingeführt, um die Sortierung im New Content Wizard bestimmen zu können. Dieser zeigt immer alphabetisch nach Dateinamen sortiert an.

Layout

Content.html:

<f:layout name="Content" />
<f:render section="Main" />

Content

Der Content c070_Well.html ist folgendermaßen definiert:

<html
    xmlns="http://www.w3.org/1999/xhtml" lang="en"
    xmlns:v="http://fedext.net/ns/vhs/ViewHelpers"
    xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
    xmlns:flux="http://fedext.net/ns/flux/ViewHelpers" >
   
{namespace flux=Tx_Flux_ViewHelpers}
{namespace v=Tx_Vhs_ViewHelpers}

<!--
#
# Rootsystem SVN
# Content Type "Well"
#
# @version $Revision: 161 $
# @lastrevision $Date: 2013-08-05 15:29:14 +0200 (Mo, 05 Aug 2013) $
# @modifiedby $LastChangedBy: erwin $
# @lastmodified $LastChangedDate: 2013-08-05 15:29:14 +0200 (Mo, 05 Aug 2013) $
# @filesource $URL: localhost/svn/layout/rsyslayout_bootstrap/trunk/Resources/Private/Templates/Content/c070_Well.html $
 -->
 
<f:layout name="Content" />

<f:section name="Configuration">
    <flux:flexform wizardTab="Rsys Inhaltselemente" id="well" icon="{v:extension.path.resources(path: 'Icons/icon-well.png')}">
        <flux:flexform.grid>
            <flux:flexform.grid.row>
                <flux:flexform.grid.column>
                    <flux:flexform.content name="content" />
                </flux:flexform.grid.column>
            </flux:flexform.grid.row>
        </flux:flexform.grid>
        <flux:flexform.field.select name="wellStyle" label="Optional Well Style Class"
            commaSeparatedItems="small, normal, large" default="normal" />
    </flux:flexform>
</f:section>

<f:section name="Preview">
    <flux:widget.grid />
</f:section>

<f:section name="Main">
    <div class="well{f:if(condition: '{0: wellStyle} != {0: "normal"}', then: ' well-{wellStyle}')}">
        <flux:content.render area="content" />
    </div>
</f:section>

</html>

Das sieht dann im Backend so aus:

Und man kann dann im Container die untergeordneten Inhaltselement anlegen:

Neuer Content

Beim Anlegen von neuen Content kann man dann wählen aus den definierten Content Typen. Hier meine derzeitige Kollektion, übernommen von der Extension specialty und weiter verfeinert und angepasst:

Bugs

Import / Export

Content, der mit fluidcontent erstellt ist hat einen gravierenden Nachteil: Man kann ihn nicht exportieren und damit auch nicht importieren mittels T3X Archiven. Grund: Beim Export kommen Fehlermeldungen "tt_content was recursive":

  • Er wählt eine Seite, die ein Container ist
  • Dann wählt er die enthaltenen Child Elemente
  • Jedes der Child Elemente wählt wieder den Parent Container (tx_flux_parent)
  • Dieser wählt wieder die Child Elemente...

Fertig ist die Endlosschleife. Das macht es unmöglich Inhalt von einer TYPO3 Instanz zu einer anderen zu bekommen. Ziemlich dumme Sache!