[TYPO3-english] Basic FLUIDTEMPLATE usage question

Thomas Skierlo pubtsk1 at pix-pro.eu
Sun Aug 26 13:13:41 CEST 2012


Hello,

heavy rain in southern holland -- and so I'm trying to get further on my 
stony way from TemplaVoila to Extbase/Fluid. I started off with my own 
extension, which is currently pretty empty. Just a name (Portable 
Layout), an Ext.key (portable_layout) and a typical folder structure -- 
but no controller or other code yet. This extension shall wrap all the 
stuff needed for page templates (Stylesheets, js, icons, Fluid templates 
and layouts) and make them kind of portable.

I defined a "constants.txt" for my extension:

plugin.tx_portable_layout {

	view {

		# cat=plugin.tx_portable_layout/file; type=string; label=Path to template root (FE)

		templateRootPath = EXT:portable_layout/Resources/Private/Templates/

		# cat=plugin.tx_portable_layout/file; type=string; label=Path to template partials (FE)

		partialRootPath = EXT:portable_layout/Resources/Private/Partials/

		# cat=plugin.tx_portable_layout/file; type=string; label=Path to template layouts (FE)

		layoutRootPath = EXT:portable_layout/Resources/Private/Layouts/

	}

	persistence {

		# cat=plugin.tx_portable_layout//a; type=int+; label=Default storage PID

		storagePid =

	}

	settings {

		# cat=plugin.tx_portable_layout/links/10; type=int+; label=Root Page UID

		rootUid = 1

		# cat=plugin.tx_portable_layout/links/20; type=int+; label=Start Page UID

		startUid = 2

		# cat=plugin.tx_portable_layout/links/30; type=int+; label=Search Page UID

		searchUid = 3

	}

}

and used "setup.txt" for the PAGE scaffolding. The FLUIDTEMPLATE part 
looks like:

	10 = FLUIDTEMPLATE

	10 {

		templateRootPath = {$plugin.tx_portable_layout.view.templateRootPath}

		layoutRootPath = {$plugin.tx_portable_layout.view.layoutRootPath}

		partialRootPath = {$plugin.tx_portable_layout.view.partialRootPath}

		settings = {$plugin.tx_portable_layout.settings}

		variables {

			sitename = TEXT

			sitename.value = Rostig, aber sonst wie neu

			# Assign the main column with {content}-destination

			content < styles.content.get

			content_left < styles.content.getLeft

		}

		# Assign the Template files with the Fluid Backend-Template

		file.stdWrap.cObject = CASE

		# Layout selection follows

		# more TS follows

	}

Everythings looks good. My page gets rendered, all assets are available 
and I can even use Partials. My variables from the FLUIDTEMPLATE object 
are also available -- but not my "settings". Do I need more than a 
barebone extension to use "settings" in my templates? If I convert them 
to variables, I can use them, but I think that's not the best way to do it.

Thanks for any help,

Thomas



More information about the TYPO3-english mailing list