[TYPO3-templavoila] constants in Templavoila

Franz Koch typo.removeformessage at fx-graefix.de
Mon Feb 16 11:46:34 CET 2009


Hi,
> i do have a question:
> I wanna use constants, which are defined in a pagetemplate with 
> templaviola template typoscript.
> 
> usr_LOGO_FILE      = value
> 
> I found
> ##############################################################
> plugin.tx_templavoila_pi1.TSconst {
>     usr_LOGO_FILE      = value
>     usr_ICON_FILE      = value
>     usr_MENU_TOP       = value
>     usr_MENU_BOTTOM    = value
>     usr_BAND_TEXT      = value
>     usr_BAND_COLR      = value
>     usr_piwik_id       = value
>     usr_copyright_name = value
>     usr_copyright_url  = value
> }
> 
> as a possible solution.
> 
> And in TV use:
> {TSconst.usr_LOGO_FILE}
> 
> In the Installation there are many constants, to manage a large number 
> of domains. Is there any way to import the global constants to the TV 
> TYPOScript, without changing all the template records for every single 
> domain.

I personally don't like writing TS code in DS, as it will be overridden 
if the DS get's updated. Therefore better write it in the "local 
processing" field of the TV template.

And to be even more flexible with constants and global TS stuff, I'm 
myself always outsourcing the TS rendering to regular TS templates and 
only copy/references the TS objects inside TV:

---- local processing ------
<T3DataStructure>
     <ROOT type="array">
         <el>
             <field_example type="array">
                 <tx_templavoila type="array">
			<TypoScript>
<![CDATA[
	10 >
	10 < lib.example
]]>
			</TypoScript>
                 </tx_templavoila>
             </field_example>
         </el>
     </ROOT>
</T3DataStructure>
----------------------------

---- TS template setup -----
lib.example = TEXT
lib.example {
	current = 1
	typolink.parameter = {$constant}
	wrap = {$config.linkWrap}
	required = 1
}
----------------------------

This way I can manage all TS at one central place and also have TSref 
easily at hand (or the T3editor if you like to use it). All TV fields 
are of course also available - to there is no disadvantage with this 
method - you can only benefit from it ;).

-- 
kind regards,
Franz Koch

---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------


More information about the TYPO3-project-templavoila mailing list