[TYPO3] Menu - home page link - styling

Darko Jr. Gonzalez jkokino at gmail.com
Sun May 11 16:34:21 CEST 2008


Hello
I've had this situation pretty much frequently. I need to generate a 
Home menu item and when I click it, it should have the same style as the 
other menu items. I have act defined. Assume this site tree:
Homepage
	Home (shortcut to Homepage)
	Page 1
	Page 2
	Page 3
	Page 4
	Page 5

Here is TS code:
lib.mainMenu = HMENU
lib.mainMenu.entryLevel = 0
lib.mainMenu.1 = TMENU
lib.mainMenu.1.noBlur = 1
lib.mainMenu.1.NO {
	wrapItemAndSub = |*||*| <li class="menu_item">|</li> || <li 
class="menu_item_last">|</li>
}
lib.mainMenu.1.ACT = 1
lib.mainMenu.1.ACT {
	wrapItemAndSub = |*||*| <li class="menu_item_act">|</li> || <li 
class="menu_item_last_act">|</li>
}

When I click Home page which is shortcut to the rootpage, well TYPO3 is 
not generating this code: <li class="menu_item_act">Home</li>. I assume 
because it is a shortcut type of page. How do I overcome this and still 
have that menu automatically generated (including Home link)?

I have searched for a solutions few months back, but I couldnt find how 
to have this, or the other way - to have the root page in this menu 
included and (I will remove the shortcut page this way).


Hardcoding a static link menu item is still a possibility but this gives 
me problems when I have the same template applied to pages which are not 
  the homepage. Hardcoding:
Homepage
	Page 1
	Page 2
	Page 3
	Page 4
	Page 5
I add <li class="menu_item_act">Home</li> in the html file and append 
HMENU/TMENU of Page1-Page5. If Page4 happens to have the same structure 
as the root page then it will show such menu:
<li class="menu_item_act">Home</li><li class="menu_item">Page1</li><li 
class="menu_item">Page2</li><li class="menu_item">Page3</li><li 
class="menu_item_act">Page4</li><li class="menu_item">Page5</li>

And the visual appeal is broken ;) I get that I am at Page4 and Homepage 
(root page) at the same time :)

Can someone please help? There must be a mechanism for this within TYPO3 :)

I tried lib.mainMenu.begin = 1 but it doesnt help.

Thanks for looking



Darko


More information about the TYPO3-english mailing list