[TYPO3-mvc] PIDless programming problem

Bastian Waidelich bastian at typo3.org
Tue May 31 12:16:20 CEST 2011


Pankaj Lele wrote:

> I changed my mind to drop idea of PIDless
> programming and start maintaining PIDs in plugin TypoScript

Really, that's a pitty.

> As it seems going complete PIDless approach will burn some
> time :)

Usually it's just a few keys in the TS Setup/Constants..
Take for example a simple list/detail view. If you want to use the list 
plugin on several pages (e.g. on the homepage as teaser and a complete 
list on some other page) the setup.txt could look something like:

// global setup for YourExtension
plugin.tx_yourextension {
	view {
		defaultPid = auto
	}
}

// setup for Plugin "List"
plugin.tx_yourextension_list {
	view {
		defaultPid = {$plugin.tx_yourextension_list.view.defaultPid}
	}
}


In the constants.txt you could add:

plugin.tx_yourextension_list {
	view {
		 # cat=plugin.tx_yourextension//a; type=int+; label=Default Page id of 
the list plugin
		defaultPid =
	}
}


But - of course - if you re-use most of your plugins on different pages, 
this might get confusing.

BTW: As an intermediate solution, you could override the defaultPids in 
the Flexform of your plugins:

<view.defaultPid>
  ...
</view.defaultPid>


HTH
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list