[TYPO3] Breadcrumb as hierarchical <ul>

Xavier Perseguers typo3 at perseguers.ch
Thu Jul 17 09:49:33 CEST 2008


>>> that might be done like other hierarchical UL-LI-menus. it depends on
>>> the correct wrapping.
> 
> This was the most important sentence: the correct wrapping.

Yes, but AFAIK a rootline is not a standard menu as you do not have to 
define the configuration of each "level", it is dynamic. For standard 
menu you have to say that 2nd level is like 1st, 3rd too, 4th too, ... 
This lets me think that you cannot think of a rootline as a standard 
menu and as such you cannot use the need-to-use wrapItemAndSub.

>>> temp.menu = HMENU
>>> temp.menu {
>>> 	wrap = <div> | </div>
>>> 	entryLevel = 1
>>> 	1 = TMENU
>>> 	1 {
>>> 		wrap = <ul>| </ul>
>>> 		NO.wrapItemAndSub = <li> | </li>
>>> 		ACT < .NO
>>> 		ACT = 1
>>> 	}
>>> 	2 < .1
>>> 	3 < .1
>>> 	4 < .1
>>> 	5 < .1
>>> }
>> This generates the whole page tree, not only the rootline.
> 
> indeed this is a normal menu, it only should show you a clean wrapping in 
> a normal menu. It is done with 'wrap' and 'wrapItemAndSub'.
> If you just try to solve it with only one kind of wrap you can't solve 
> the puzzle.

Exactly! And this is why I think it is not possible.

>> I think I'll simply code it myself using a USER func. I did once to get
>> a rootline to an arbitrary page. I do not think it is possible to do it
>> using pure TS as this is not a standard menu.
>  
> TYPO3 configuring by using typoscript is unusual for programmers and a 
> lot of problems seem to have no solution, but I state you: these are the 
> parts where you can learn typoscript - and it is worth the effort.

I know that and I'm the first to try using pure TS but I could not get 
it work. Now, this is what I have yet:

mypage.5 = HMENU
mypage.5 {
	special = rootline
	special.range = 0|-1

	1.wrap = <ul>|</ul>
	1 = TMENU
	1.NO {
		stdWrap.field = title
		linkWrap = <li>|<ul><li> |*| |<ul><li> |*| |</li></ul>
	}
}

And it is OK but it does not close all <li>'s and <ul>'s that were open.

If I could say after that: "Now count the levels and for each append 
</li></ul> to the end of the generated rootline", that would be OK.

I tried to use a standard definition of wrapItemAndSub with

2 < .1
3 < .2

etc. but then the rootline becomes a standard menu showing both the 
rootline in '1' and the whole menu tree in 2 and the rest.

Another solution would be (perhaps) to use a userfunc that returns the 
hierarchical menu using TSFE->rootline and then use a standard 
hierarchical menu generation with wrapItemAndSub and defining up to 10th 
level for instance.

I don't see another solution yet.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en/tutorials/typo3.html


More information about the TYPO3-english mailing list