Created
November 5, 2014 15:47
-
-
Save a-r-m-i-n/0798df7700bf379e73a9 to your computer and use it in GitHub Desktop.
Using Fluid-Templates in TYPO3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page = PAGE | |
page { | |
typeNum = 0 | |
10 =< lib.templates.base | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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