[TYPO3-dev] Getting id of the page

Tapio Markula tapio.markula at dnainternet.net
Fri Aug 25 10:29:09 CEST 2006


Martin Ficzel kirjoitti:
> Tapio Markula schrieb:
>> Hi
>>
>> I would need for function 'docStyle()' for class.ux_template.php
>>
>> the id of the page, which has been opened.
>> I tried to get it from $_GET parameter
> 
> did you have a look at the $GLOBALS['TSFE'] object;
> 
> t3lib_div::debug($GLOBALS['TSFE']);
> 
> as far as i remember $GLOBALS['TSFE']->id is what you need.

doesn't existin required context


	function docStyle()	{
		global $skin_grey_2Conf,$BE_USER;
		
		print $GLOBALS['TSFE']->id;
no printing result
> 
> another important function is t3lib_div.getIndpEnv
where to use

Concerning $_GET
this works in BE

		if(isset($_GET['id']))
			$id = $_GET['id'];
		else	{
			$id = strrchr($_GET['returnUrl'],'id=');
			$id = substr($id,3);
			if(strpos($id,'&table')) {
				$idPos = strpos($id,'&table');
				$id = substr($id,0,$idPos);
				}
			}

In BE returnUrl has
just no additional info than id or id + '&table'.
But in FE that doesn't work because 'returnUrl' has different
values.




More information about the TYPO3-dev mailing list