Zurück zum Blog

Flexible Inhaltselemente kategorisieren

Flexible Inhaltselemente kategorisieren

Besonders komfortabel bei der Arbeit mit TemplaVoila! ist der Einsatz von Flexiblen Inhaltselementen (FCE). Jeder, der mal eine TYPO3 Webseite mit sehr viele verschiedenen FCEs gebaut hat, kennt jedoch das Problem, dass die Liste der FCEs beim Anlegen eines Inhaltselements sehr lang wird und die Bedienung dadurch etwas umständlich. Deswegen bietet es sich an, die FCEs nach ihrer Art in Tabs zu kategorisieren. Dies kann man wie folgt in TYPO3 umsetzen.

Der Ausgangspunkt ist dabei der „newContentElement“-Wizard von TemplaVoila. Erreichbar ist dieser in der Seiten-TS-Config:

tmp.wizards < templavoila.wizards.newContentElement.wizardItems
templavoila.wizards.newContentElement.wizardItems >

Benutzt wird das temporäre Objekt um die Anpassungen an das ursprüngliche Objekt zu übergeben.

templavoila {
 wizards.newContentElement {
 wizardItems {
 # Tab: "Typical page content"
 common < tmp.wizards.common
 # shorten tab label (width is limited)
 common.header = Typisch

 # Tab: "Special elements" + "Form elements"
 special < tmp.wizards.common
 special.header = Speziell
 special.elements {
 # move form elements
 mailform < tmp.wizards.forms.elements.mailform
 search < tmp.wizards.forms.elements.search
 login < tmp.wizards.forms.elements.login
 }
 special.show := addToList(mailform,search,login)

 #new custom tab
 grids.header = Grids
 grids.elements {
 # already created TemplateObject
 2cols50-50 {
 title = 2 Spalten 50-50
 description = 2spaltiges Container-Element, Breite 50%-50%
 # path to TO icon may vary
 icon = ../../../../typo3/../uploads/tx_templavoila/2-col-50-50.gif
 # define ContentType
 tt_content_defValues {
 CType = templavoila_pi1
 tx_templavoila_ds = fileadmin/templates/ds/fce/2 Spalten (fce).xml
 # ID of TO
 tx_templavoila_to = 2
 }
 }
 }
 # show all TO's in list
 grids.show = *

 fce < tmp.wizards.fce
 # add fce TO's
 # fce.show = fce_2,fce_3

 plugins < tmp.wizards.plugins
 }
 }
}

Wie das Ganze dann fertig aussieht, könnt ihr euch in den Screenshots ansehen.

Flexible Inhaltselemente kategorisieren | Flagbit Digitalagentur