[TYPO3-dev] non-standard page types and extension configuration info?

Thorsten Kahler thorsten.kahler at dkd.de
Tue Jun 5 16:47:17 CEST 2007


Hi Jason,

Jason Lefkowitz wrote on 04.06.2007 22:58:
> alternate page type to accomplish this.  From the extensions Typoscript
> setup:
> 
> xmlPage = PAGE
> xmlPage.pageNum = 9999
> xmlPage.config.disableAllHeaderCode = 1
> xmlPage.config.additionalHeaders = Content-type: application/xml
> xmlPage.10 < plugin.tx_myextension_pi1
> 

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).

> This works fine -- the page comes back as XML, with the right MIME type
> and everything, when I hit it using the pageNum (i.e.
> index.php?id=1&type=9999).
> 
> The problem is when I try to get the data set in the plugin's Flexform.
>   An example would be the startingpoint set by the user.  When I hit the
> page without the special pageNum (i.e. index.php?id=1), I can get the
> startingpoint this way:
> 
> $startingPoint = $this -> cObj -> data['pages'];
> 
> However, when I hit it WITH the pageNum (index.php?id=1&type=9999),
> $startingPoint is empty.
> 

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

*/
	}
}

####



Regards
Thorsten




More information about the TYPO3-dev mailing list