[TYPO3-dev] meta data from plugin

Bart van den Burg bart at samson-it.nl
Wed Feb 2 13:36:46 CET 2011


Op 2-2-2011 10:24, Jacob Rasmussen schreef:
> Den 01/02/11 17.35, Bart van den Burg skrev:
>> I wish to set meta description and meta keywords from within my plugin,
>> but I don't quite understand how...
>>
>> In my main template setup i have the following two lines:
>>
>> page.meta.keywords.field = keywords
>> page.meta.description.field = description
>>
>> These work fine, they fetch the values from whatever is configured for
>> the page. Now I have a plugin from which i want to dynamically set these
>> values. How do I do this?
>>
>> I tried $GLOBALS['TSFE']->page['meta.']['keywords.']['overwrite'], but
>> it doesn't work...
>>
>
> Hi Bart,
>
> I had to do it through Typoscript instead of coding it directly in my
> plugin.
>
> The plugin has a list and single view mode on different pages - and on
> the single view page I added this to Typoscript setup:
>
> page.meta.description.cObject = RECORDS
> page.meta.description.cObject {
> source = {GPvar:tx_blnews_pi1|n}
> source.insertData = 1
> tables = tx_blnews_items
> conf.tx_blnews_items >
> conf.tx_blnews_items = TEXT
> conf.tx_blnews_items {
> field = teaser
> }
> }
>> Where tx_blnews_pi1|n is the identifier variable from the plugin.
> It is a bit annoying that I have to do more than one database lookup,
> but it's working at least :)
>

Hi,

Thanks! It works like a charm.

Regards,
Bart




More information about the TYPO3-dev mailing list