You are here:  Home    Blog    TYPO3: Advanced keywords
 

TYPO3: Advanced keywords

TYPO3: Advanced keywords
Thursday, October 18, 2007 at 02:27 PM

On the web, a keyword is a reference to the content and/or the type of meta tag included in a given web page's HTML code to aid in the page's indexing. A keyword meta tag may include several comma-separated keywords (or keyword phrases, each of which may contain several individual words) as follows:

<meta name="keywords" 
content="typo3,open source,consulting,belgrade" />

Historically it has been the first way to do search engine optimization. Adding popular term to the meta keyword list will allow your site to appear in most search results on popular search engines.

If you want to find out how to add advanced keywords in TYPO3 with support for inheritance and tt_news/timtab extensions read on this post.

Enabling keywords

First step is to enable keywords in your TypoScript template:

page.meta.keywords.field = keywords

Now you can add keywords to any page as shown on the figure 1, and they will show up in the front end ready to be picked up by various crawlers.


Figure 1. Adding keywords in TYPO3 back end

Just enabling keywords this way forces you to add keywords separately for each page you want to be rendered with meta keywords tag. If you have a lot of pages this can be time consuming.

Enabling inheritance

Given that pages in your page tree are grouped in terms of content (and in terms of keywords by that matter), it makes sense to enable inheritance of keywords as well. What it means that if you do not define keywords for a page, TYPO3 will look for keywords in parent page as so on, until it finds keywords or it reaches the root page.

To enable inheritance add the following line in your TypoScript template (instead of the one in the previous section:

page.meta.keywords.data = levelfield: -1,keywords,slide

This requires also to add keywords column in the rootline array. You can do that by modifying localconf.php:

$TYPO3_CONF_VARS['FE']['addRootLineFields'] .= ',keywords';

And that's it - you now have fully working keywords with inheritance.

Enabling tt_news keywords

If you use tt_news or timtab extensions on your web site, and in order to further improve keyword rendering algorithm, you should add support for rendering of the tt_news keywords. You can do that with help of newsKeywords register and page.headerData:

page.headerData {
    1 = TEXT
    1.value = <meta name="keywords" content="
    2 = TEXT
    2.data = register : newsKeywords
    2.required = 1
    2.wrap = |,  
    3 = TEXT
    3.data = levelfield: -1,keywords,slide
    4 = TEXT
    4.value = " />
}

Since this piece of TypoScript code also uses inheritance, you will need to change the localconf.php and add keywords column to the rootline as well.

This enables inheritance of keywords for regular pages, and per news keywords on the single blog post/news page. When rendering tt_news record keywords, they will take precedence over single blog post/news page keywords.

This entry was posted on Thursday, October 18, 2007 at 02:27 PM and is filed under TYPO3, Open source, Tips & tricks. You can leave a response, or trackback from your own site.
Bookmark now:
co.mmentsdel.icio.usdigg.comgoogle.comhype it!live.comnetscapeTechnoratiYahooMyWeb

3 Responses to “TYPO3: Advanced keywords”

Comment from cacleRoopeSet
on Wednesday, 01-10-08 14:39
Hi all!
Nice site!

G'night
Comment from Jon
on Monday, 11-08-08 15:26
Nice - but: Multipage News (pagebreak) will share the same Metadata for different URLs and different content, not optimal ...
Do you see anyway around this.
Summet: I could answer your questions but I rather don't. Messing around with the localconf before you know what a typoscript template is is begging for desaster ....
Comment from Sumeet
on Thursday, 12-06-08 16:09
This seems to be just what I need to do on our website. I am not a developer and am trying to add these keywords.

1. "First step is to enable keywords in your TypoScript template" Where do I find what you call "TypoScript template"

2. Once I find the template, where do I add the code line you say should be added?

3. Where do i find "localconf.php"

Thanks in anticipation for helping me out here.

Sumeet

Posting comments is currently turned off as this web site has stale content at the moment. Please stay tuned for our new web-site which will be online soon.

 

2007-2010 © Essential Dots d.o.o. All rights reserved.