[TYPO3] Templavoila and content type script

Guus Leeuw jr. Guus-Leeuw at gmx.de
Mon Jan 15 17:42:49 CET 2007


Hello,

 

The concept of content type script appeals to me for various reasons, the
main being that from one template, one can execute various code snippets,
all cutely defined via the

tt_content.script = CASE

tt_content.script.key.field = select_key

tt_content.script.myFirstScript = USER_INT

tt_content.script.myFirstScript {

            userFunc = myFirstClass->main

            includeLibs = fileadmin/dir/global_library.php

}

tt_content.script.mySecondScript = USER_INT

tt_content.script.mySecondScript {

            userFunc = mySecondClass->main

            includeLibs = fileadmin/dir/global_library.php

}

 

With nice PHP classes ala

class myFirstClass {

 function main($content, $conf) {

  return “You’re here!”;

 }

}

class mySecondClass {

 function main($content, $conf) {

  return “You’re there!”;

 }

}

 

And usage in the Pagecontent as

Type: Script

CODE: myFirstScript

 

Now, this is all nice, and supposedly works (yes, yes, I should test it ;),
*but* can I somehow (and then of course how ;) integrate this concept of
coding into templavoila, so that my page template calls 

page.10.userFunc = tx_templavoila_pi1->main_page

which, while doing it’s job, figures out that tt_content:uid xyz is a script
called myFirstScript and consequently looks up the definition of that script
in the TS of the templavoila array.

If not, I tried putting the above in the page template, which did not yield
the expected (? ;) result.

 

Has anyone tried it out there and can guide me as to how I would implement
it?

 

OTOH, I could of course write a whole bunch of extensions with front-end
plugins, but that doesn’t really suite me, since the stuff I want to
implement interfaces with a database that has data that really should reside
outside the TYPO3 database (organizational operations data !!).

 

Please let me know, or give me some pointers. I’d be willing to extend the
templavoila stuff if that is what it takes, but then again templavoila is
pretty strong nowadays ;)

 

Regards,

Guus


-- 
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.433 / Virus Database: 268.16.10/626 - Release Date: 14/01/2007
20:29
 


More information about the TYPO3-english mailing list