[Typo3-dev] rendering content by id
Martin Kutschker
martin.kutschker at no5pam.blackbox.net
Thu Jun 16 14:09:47 CEST 2005
"Kraft Bernhard" <kraftb at gmx.net> schrieb im Newsbeitrag
news:mailman.1.1118911928.10426.typo3-dev at lists.netfielders.de...
> Kraft Bernhard wrote:
>> $HTTP_GET_VARS['id'] = $temp_page_id;
>> $TSFE = new $temp_TSFEclassName(
>> $TYPO3_CONF_VARS,
>> t3lib_div::_GP('id'), t3lib_div::_GP('type'),
>> t3lib_div::_GP('no_cache'),
>> t3lib_div::_GP('cHash'),
>> t3lib_div::_GP('jumpurl'),
>> t3lib_div::_GP('MP'),
>> t3lib_div::_GP('RDCT')
>> );
>> $content = $this->cObj->cObjGetSingle($this->conf['page'],
>> $this->conf['page.']);
>
> Just investigated it a little more ... I think it shall be sufficient to
> do the following things:
>
> $temp_copy_TSFE = $GLOBALS['TSFE']; // store original TSFE
> $GLOBALS['TSFE']->id = $GLOBALS['TSFE']->contentPid = $PAGE_TO_RENDER_ID;
> $GLOBALS['TSFE']->getPageAndRootlineWithDomain($GLOBALS['TSFE']->config['config']['content_from_pid_allowOutsideDomain']?0:$GLOBALS['TSFE']->domainStartPage);
> $pageContent = $GLOBALS['TSFE']->cObj->cObjGet($this->conf['page.']);
> $GLOBALS['TSFE'] = $temp_copy_TSFE; // Restore original TSFE
> // Content in "pageContent"
But if your current page URL has any of the above menition GP-vars set then
your pages rendered "off-screen" will be affected, won't they? Isn't it more
safe to do it like this?
$temp_copy_TSFE = $TSFE;
$TSFE = new $temp_TSFEclassName(
$TYPO3_CONF_VARS,
$offscreenId,
$offcsreenType,
$offscreenNoCache,
'', '', '','')
);
$content = $this->cObj->cObjGetSingle($this->conf['page'],
$this->conf['page.']);
$TSFE = $temp_copy_TSFE;
Masi
More information about the TYPO3-dev
mailing list