[Typo3] Getting values from TS into an extension

Kraft Bernhard kraftb at gmx.net
Wed Apr 27 09:48:29 CEST 2005


Martin Rud wrote:
> Hi list
> 
> When I write an extension (e.g. with the key "myextension"); how do I get values from TS config? Say I have this TS:
> 
> plugin.myextension.myvalue = funnystuff
> 
> How do I get this into the extension files. Is it, by the way, different when I want them to go into FE vs. BE (pi1, pi2, pi3,.. vs. mod1, mod2,..)?
> 
> Hope I made myself clear! :o)

1.
TypoScript isn't used in the BE. Only TSConfig. So you will never be able to set values per TS and retrieve
it with an BE module (except you do some really nasty things :)

2.
When you take a look at the ->main method of your piN plugin you will set that it is defined as follows:
main($content, $conf) {

The variable $conf is passed. Let's say if your plugin is called tx_myext_pi1 then you will be able to
retrieve the contents of
plugin.tx_myext_pi1 {
	key = value
}
by using
$conf['key'];

Normally you do:
$this->conf = $conf;

at the very beginning of your main method (except your extension has just a single method then thats useless
as you can always use $conf)


I also hop I made myself clear :-)


greets,
Bernhard
-- 
Kraft Bernhard
MOKKA Medienagentur <http://www.mokka.at>
T: +43 - 1 - 895 33 33 - 50



More information about the TYPO3-english mailing list