[TYPO3-mvc] Feature: automatic target page determination

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Aug 5 09:10:33 CEST 2010


Hi Bastian,

Bastian Waidelich schrieb am 03.08.2010 18:12:

> (...)
> Now the interesting part:
> defaultPid defaults to the string "auto". If that is not overridden, the
> UriBuilder detects the page that contains the requested plugin (SELECT
> pid FROM tt_content WHERE list_type=[plugin_signature] AND hidden = 0
> AND deleted = 0).

I like the "auto-magic".

Consider adapting your query. Instead of:

$pages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'tt_content',
'list_type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($pluginSignature,
'tt_content') . ' AND hidden=0 AND deleted=0', '', '', 2);

better use enableFields (also considers start/endtime/permissions):

$pages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
	'pid',
	'tt_content',
	'list_type=' .
		$GLOBALS['TYPO3_DB']->fullQuoteStr($pluginSignature, 'tt_content') .
		$GLOBALS['TSFE']->sys_page->enableFields('tt_content'),
	'',
	'',
	2
);

Cheers,
Ernesto


More information about the TYPO3-project-typo3v4mvc mailing list