[TYPO3-dev] non-standard page types and extension configuration info?
Jason Lefkowitz
jason at jasonlefkowitz.net
Tue Jun 5 18:50:27 CEST 2007
Thorsten,
thanks for your response. After reading your explanation, I understand
conceptually why the plugin needs to be 'bound' to a content object.
But knowing that, I don't follow the example code you gave. Why do you
need the CASE statement in there?
If it's a matter of specifying a content object I had thought this
approach might work, but it doesn't:
includeLibs.my_extension = EXT:my_extension/pi1/class.tx_myextension_pi1.php
plugin.my_extension = USER
plugin.my_extension {
userFunc = my_extension -> main
}
xmlPage = PAGE
xmlPage.pageNum = 9999
xmlPage.config.disableAllHeaderCode = 1
xmlPage.config.additionalHeaders = Content-type: application/xml
xmlPage.10 < plugin.my_extension
What do you think?
-- Jason
Thorsten Kahler wrote:
> if you render the document like that the plugin doesn't belong to any
> content element. "Normal" document rendering selects content elements (table
> tt_content) from the current page (field pid). The renderObj defines how the
> datasets should be rendered in detail (e.g. as PI tx_myextension_pi1).
...
> You have to bind your plugin to a content element else the array
> $this->cObj->data (which contains the dataset) is empty.
>
>> The same thing happens with the Flexform I set up to allow configuration
>> of the plugin output. None of the settings come through in
>> $this->cObj->data['pi_flexform'] when using the pageNum, even though I
>> have "$this->pi_initPIflexForm();" in my script.
>>
> Same here.
>
>> Is there some special thing I have to do to get access to plugin
>> configuration data like the starting point when using non-standard page
>> types?
>>
>
> A small change in your TS setup should do (untested):
>
> ####
>
> xmlPage = PAGE
> xmlPage.pageNum = 9999
> xmlPage.config.disableAllHeaderCode = 1
> xmlPage.config.additionalHeaders = Content-type: application/xml
> # select datasets from current page
> xmlPage.10 < styles.content.get
> xmlPage.10 {
> renderObj = CASE
> renderObj {
> key = CType
> # restrict to CType "list" (i.e. plugins)
> list = COA
> list {
> # restrict to plugin my_extension_pi1
> if.value = my_extension_pi1
> if.equals.field = list_type
> # render dataset
> 10 < plugin.tx_myextension_pi1
> }
> /* alternative
> # you have to check field list_type in PHP
> # e.g: if ($this->cObj->data['list_type'=='my_extension_pi1')
> list < plugin.tx_myextension_pi1
>
> */
> }
> }
>
More information about the TYPO3-dev
mailing list