Showing posts with label TypoScript. Show all posts
Showing posts with label TypoScript. Show all posts

Thursday, 1 January 2015

Overwrite title tag with TypoScript

TYPO3 is a powerful CMS that uses its own configuration language called TypoScript. This article does not explain what or how to configure TYPO3. In this case only show you how to override the title tag of a page using TypoScript. To develop this example we used a quite old version of TYPO3: 4.2.14 but this solution is also valid for newer versions. Suppose we want new title "Test", then the TypoScript of our template should be:
config.noPageTitle = 2
page = PAGE
page.headerData.10 = TEXT
page.headerData.10.wrap = <title>Test</title>
In the first line we say that we don't want to print the default title. More info here. In the other 3 lines we change the page header adding our title. I hope you find it useful! Regards!

Thursday, 10 April 2014

HMENU: add class to li tag

Hello,

Today I was creating a new HMENU with Typoscript and I have found a problem. I had this HMENU already configured:

temp.links = HMENU temp.links.special = list temp.links.special.value = 1,2,3,4,5 temp.links { 1 = TMENU 1 { wrap = <ul>|</ul> NO.linkWrap = <li>|</li> } }

Then I saw that I wanted to add a class in the last li tag. The solution is:

temp.links = HMENU temp.links.special = list temp.links.special.value = 1,2,3,4,5 temp.links { 1 = TMENU 1 { wrap = <ul>|</ul> NO.linkWrap = <li>|</li>|*||*|<li class="specialClasss">|</li> } }

Best regards!