[TYPO3-templavoila] How to access a translated page title in extension?
Dmitry Dulepov
9f4eetb02 at sneakemail.com
Fri Apr 20 14:48:45 CEST 2007
Anders Tillbeck wrote:
> Dmitry Dulepov skrev:
>> Anders Tillbeck wrote:
>>> After using the TemplaVoila to translate at site to multible
>>> languages I have now a small problem. I have made an extension that
>>> can list page titles using these fields:
>>>
>>> $details = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $res_page );
>>> $details['title'];
>>>
>>> But using it on a page with multible languages made using TemplaVoila
>>> my extension only selects the "real" page title and not the tranlated
>>> page title for any secondary language.
>>>
>>> How can I change the above TS to get the true translated page title
>>> instead of the default page title?
>>
>> This is not depended on templavoila. You need to make this call:
>>
>> $GLOBALS['TSFE']->sys_page->getRecordOverlay('pages', $details,
>> $curLang);
>>
>> where $curLang is language ID (value of "L").
>>
>
>
> Thanks for your fast answer :-)
>
> I have tried:
> $details = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $res_page );
> $GLOBALS['TSFE']->sys_page->getRecordOverlay('pages', $details, 1);
> This writes out "Array"
>
> $details = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $res_page );
> $GLOBALS['TSFE']->sys_page->getRecordOverlay('pages', $details, 1);
> This wries out the original page title. But not the one for translation
> &L=1
>
> You seem to know this well so I hope that you can see what to do
> different in the above two examples to get the translated title :-)
Both your code fragments look identically...
Actually for page record you can easier approach:
$GLOBALS['TSFE']->sys_page->getPageOverlay($GLOBALS['TSFE']->id,
$GLOBALS['TSFE']->sys_language_uid);
This will return you page record overlayed with current language.
--
Dmitry Dulepov
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
More information about the TYPO3-project-templavoila
mailing list