Skip to content

Instantly share code, notes, and snippets.

@a-r-m-i-n
Created November 5, 2014 15:47
Show Gist options
  • Save a-r-m-i-n/0798df7700bf379e73a9 to your computer and use it in GitHub Desktop.
Save a-r-m-i-n/0798df7700bf379e73a9 to your computer and use it in GitHub Desktop.
Using Fluid-Templates in TYPO3
page = PAGE
page {
typeNum = 0
10 =< lib.templates.base
}
<!-- Example Fluid Template -->
<div id="website">
<div id="header">
<div id="logo">
{logo -> f:format.raw()}
</div>
<div id="navigation">
{navMain -> f:format.raw()}
</div>
</div>
<div id="content">
<div id="left">
{columnLeft -> f:format.raw()}
</div>
<div id="main">
{columnMain -> f:format.raw()}
</div>
</div>
</div>
# Initiate template (used by page)
lib.templates.base = FLUIDTEMPLATE
lib.templates.base {
partialRootPath = fileadmin/templates/html/Partials/
layoutRootPath = fileadmin/templates/html/Layouts/
variables {
logo =< lib.contents.logo
navMain =< lib.navigations.main
columnLeft =< styles.content.getLeft
columnMain =< styles.content.get
}
}
# Choose template file (based on backend_layout, respecting heredity)
lib.templates.base.file.stdWrap.cObject = CASE
lib.templates.base.file.stdWrap.cObject {
key.field = backend_layout
key.ifEmpty.data = levelfield : -1 , backend_layout_next_level, slide
default = TEXT
default.value = fileadmin/templates/html/template_main.html
# This syntax comes from filebased backend layouts:
typo3sz_base__main-nosidebar = TEXT
typo3sz_base__main-nosidebar.value = fileadmin/templates/html/template_nosidebar.html
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment