[TYPO3] how to build a link with pid and uid

Sven Jürgens news at blue-side.com
Sun Sep 28 21:47:15 CEST 2008


Kay Strobach schrieb:
> Sven Jürgens schrieb:
>> has anyone a hint for me ?
>>
>> I want to write an FrontEnd extension.
>> In the Backend you can select a page and in the Frontend it should be
>> a link to that page.
>> I imagine something like that
>>
>> <a href ="uid" title="pid:title - uid:title">pid:title - uid:title</a>
>>
>> But how can i get the title of the pid with localisation in mind.
>>
>> Greetings Sven
> 
> Hello Sven,
> 
> insert this in your fe plugin class
> 
> $pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');
> $page = $pageSelect->getPage($id,false);
> //alternative
> $page = $pageSelect->getPage_noCheck($id,false);
> 
> $str = $page['title'];
> 
> $content.=$this->pi_linkTP(
>     $str,
>     $id,
>     $target='',
>     $urlParametersArray=array()
> )
> 
> more info @ 
> http://doxygen.frozenkiwi.com/typo3/html/d1/d86/classt3lib__pageSelect.html#9a58fc0813ea6472b78aefa0b30a1470 
> 
> or
> http://doxygen.frozenkiwi.com/typo3/html/
> 
> CU Kay

Hello Kay,

thanks for the hint. :)
But in my configuration it doesn't work.
I only get the page[title] of sys_language_uid = 0.

After some testing and searching i found
$GLOBALS['TSFE']->sys_page->getPage($uid)
and it works perfect.
Now i use $GLOBALS['TYPO3_DB']->exec_SELECTgetRows to get the uid and 
pids and with $GLOBALS['TSFE']->sys_page->getPage($uid) i get the 
localized pagetitle of uid and of the pid.

Greetings Sven


More information about the TYPO3-english mailing list