[TYPO3-dev] Best practices for distributed TypoScript development

Bastian Waidelich waidelich at network-publishing.de
Fri May 16 11:20:19 CEST 2008


Steffen Müller wrote:

> What's your best practice with TS?

Hi Steffen,
we're using the include syntax for all our TS setup (even pageTSConfig). 
Only Constants that apply to the very instance of the TYPO3 installation 
(baseURL, PIDs, email addresses etc.) are set via the constants field of 
the root template.

 > Robert mentioned, that you then might get problem with the cascade.

You can't include other files from within included TS, but you don't 
have to. We use to have the files:

constants.ts
config.setup.ts
page.setup.ts
page.tsconfig.ts
extensions.setup.ts
libObjects.setup.ts

and in the root-template setup field nothing more than:

<INCLUDE_TYPOSCRIPT: source="FILE: local_path/config.setup.ts">
<INCLUDE_TYPOSCRIPT: source="FILE: local_path/page.setup.ts">
<INCLUDE_TYPOSCRIPT: source="FILE: local_path/libObjects.setup.ts">
<INCLUDE_TYPOSCRIPT: source="FILE: local_path/extensions.setup.ts">

in the constants field:

<INCLUDE_TYPOSCRIPT: source="FILE: local_path/constants.ts">

plus the settings for the current TYPO3 instance:

baseURL = http://domain.tld/

rootPID = 1
feuserPID = 439
...


Inernally we're using one tiny extension to replace the INCLUDE-tags by 
the actual file contents when editing the setup-field and writing back 
changes to the file (so you dont have  to change to the filelist module 
in order to change your TS setup).
We'll release the extension soon I hope!

With this setup you're able to store almost all relevant configuration 
in your subversion repository making it much easier to collaborate. 
Furthermore it allows you to set up development/testing environments 
within minutes and to keep them in synch with your live site.

<ad>if you're using our extension np_subversion, you can even use your 
fileadmin/templates folder as working copy and prevent changes from 
getting lost</ad>


btw: using no hard coded PIDs and template-paths in the setups is a 
requirement. so instead of:

plugin.tx_newloginbox_pi1 {
	templateFile = fileadmin/templates/mysite/extTmpl/newloginbox/default.html
	storagePid = 123
}

you could write:

plugin.tx_newloginbox_pi1 {
	templateFile = {$templateRoot}extTmpl/newloginbox/default.html
	storagePid = {$feuserPID}
}

have fun
Basti ;)




More information about the TYPO3-dev mailing list