Discussion:
[TYPO3-english] hmenu: special directory - is it possible to show the parent page in the menu as well?!
Daniel Rutzen
2009-09-30 16:28:26 UTC
Permalink
I have a page tree like this:

-- Page 1
-- Page 2
---- Page 2 subA
---- Page 2 subB
---- Page 2 subC
-- Page 3
---- Page 3 subA
---- Page 3 subB


Now, I would like a menu, that dispays only the parent Page 2, and all
its sub-pages. (like this)
Page 2
- Page 2 subA
- Page 2 subB
- Page 2 subC

I tried with special = directory, but that doesnt include the parent
item itself.

Anyone a clue ?
Tyler Kraft
2009-09-30 16:47:10 UTC
Permalink
Really?!

Use
temp.nav = HMENU
temp.nav{
special =list
special.value = Page 2 uid
1=TMENU
2 < .1
}

(I think that actually might do it!)
Post by Daniel Rutzen
-- Page 1
-- Page 2
---- Page 2 subA
---- Page 2 subB
---- Page 2 subC
-- Page 3
---- Page 3 subA
---- Page 3 subB
Now, I would like a menu, that dispays only the parent Page 2, and all
its sub-pages. (like this)
Post by Daniel Rutzen
Page 2
- Page 2 subA
- Page 2 subB
- Page 2 subC
I tried with special = directory, but that doesnt include the parent
item itself.
Anyone a clue ?
Xavier Perseguers
2009-09-30 16:47:45 UTC
Permalink
Hi,
Post by Daniel Rutzen
-- Page 1
-- Page 2
---- Page 2 subA
---- Page 2 subB
---- Page 2 subC
-- Page 3
---- Page 3 subA
---- Page 3 subB
Now, I would like a menu, that dispays only the parent Page 2, and all
its sub-pages. (like this)
Post by Daniel Rutzen
Page 2
- Page 2 subA
- Page 2 subB
- Page 2 subC
I tried with special = directory, but that doesnt include the parent
item itself.
Anyone a clue ?
You may use a COA and compose the page2 yourself while having the hmenu concatenated.
--
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away
Katja Lampela
2009-10-01 06:04:41 UTC
Permalink
Hi
I just had almost similar case. I used this code:

lib.leftmenu = COA
lib.leftmenu {
10 = TEXT
10.data = leveltitle:2
10.wrap = <div id="your-menu-header-class">|</div>

# Leftside Navigation
20 = HMENU
20.entryLevel = 2
20.1 = TMENU
20.1 {
noBlur = 1
wrap = <ul>|</ul>
ACT = 1
CUR = 1
and blah blah...

}
}

With kind regards

Katja Lampela
*Lieska-tuotanto
* www.lieska.net
Post by Daniel Rutzen
-- Page 1
-- Page 2
---- Page 2 subA
---- Page 2 subB
---- Page 2 subC
-- Page 3
---- Page 3 subA
---- Page 3 subB
Now, I would like a menu, that dispays only the parent Page 2, and all
its sub-pages. (like this)
Post by Daniel Rutzen
Page 2
- Page 2 subA
- Page 2 subB
- Page 2 subC
I tried with special = directory, but that doesnt include the parent
item itself.
Anyone a clue ?
Daniel Rutzen
2009-10-01 11:18:49 UTC
Permalink
THIS IS WHAT I WANT TO DO:

I have a horizontal MAINMENU main A | main B | main C

I have a vertical SECONDMENU ("leftmenu") on the left, which shows the
title of the current main item, and below it displays the subpages of
the current main-page.
main A (which is also a link to 'main A' again)
- subpage A1
- subpage A2
- subpage A3
main B (which is also a link to 'main B' again)
- subpage B1
- subpage B2
- subpage B3


LEFTMENU's html output must be like this:

<ul id="leftmenu">

<li><a href="main A.html">main A</a>
<ul>
<li><a href="subpage_A1.html">subpage A1</a>
<li><a href="subpage_A2.html">subpage A2</a>
<li><a href="subpage_A3.html">subpage A3</a>
</ul>
</li>

</ul><!-- end leftmenu -->


To This point, it all works!!! that's not the issue.

Here's the kicker:

On Page "Main A" I want the leftmenu to display the pages
corresponding to page "Main B".

So, "Main A" must show in the leftmenu
main B (which is also a link to the same page)
- subpage B1
- subpage B2
- subpage B3
Tyler Kraft
2009-10-01 11:28:13 UTC
Permalink
Hi,

Right and that is different than what you asked for previously. So when
on horizonatal A or B display vertical menu B. Fine I'd suggest that you
get it to all work fine when on horizontal B, and from what you've said
it does. FYI for the vertical menu I'd use entryLevel

Then when on A simply change the menu slightly

[globalVar = TSFE:id= uid_of_A ]
SECONDMENU {
enrtyLevel>
special = list
special.value = uid_B
}
[global]

Does that solve it for you?
Post by Daniel Rutzen
I have a horizontal MAINMENU main A | main B | main C
I have a vertical SECONDMENU ("leftmenu") on the left, which shows the
title of the current main item, and below it displays the subpages of
the current main-page.
main A (which is also a link to 'main A' again)
- subpage A1
- subpage A2
- subpage A3
main B (which is also a link to 'main B' again)
- subpage B1
- subpage B2
- subpage B3
<ul id="leftmenu">
<li><a href="main A.html">main A</a>
<ul>
<li><a href="subpage_A1.html">subpage A1</a>
<li><a href="subpage_A2.html">subpage A2</a>
<li><a href="subpage_A3.html">subpage A3</a>
</ul>
</li>
</ul><!-- end leftmenu -->
To This point, it all works!!! that's not the issue.
On Page "Main A" I want the leftmenu to display the pages
corresponding to page "Main B".
So, "Main A" must show in the leftmenu
main B (which is also a link to the same page)
- subpage B1
- subpage B2
- subpage B3
Daniel Rutzen
2009-10-01 12:35:45 UTC
Permalink
The problem is:

special=list
special.value = uidPageB

only gives me one menu entry: pageB
The subpages are not listed.
Post by Tyler Kraft
Hi,
Right and that is different than what you asked for previously. So when
on horizonatal A or B display vertical menu B. Fine I'd suggest that you
get it to all work fine when on horizontal B, and from what you've said
it does. FYI for the vertical menu I'd use entryLevel
Then when on A simply change the menu slightly
[globalVar = TSFE:id= uid_of_A ]
SECONDMENU {
enrtyLevel>
special = list
special.value = uid_B
}
[global]
Does that solve it for you?
Tyler Kraft
2009-10-01 13:14:28 UTC
Permalink
Really? Build a second level to the menu.

The same way that SECONDMENU.1=TMENU displays the first menu level
simply use SECONDMENU.2=TMENU to show the second level. There might be
other properties that you need to specifically use depending upon the TS
and the page structure, but I have no idea as you've helpfully actually
not posted either of those.

I hate to say it but you need to read TSref, as it has everything in it
that you need. Look at HEMNU, TMENU and TMENUITEM

hth
Post by Daniel Rutzen
special=list
special.value = uidPageB
only gives me one menu entry: pageB
The subpages are not listed.
Post by Tyler Kraft
Hi,
Right and that is different than what you asked for previously. So
when on horizonatal A or B display vertical menu B. Fine I'd suggest
that you get it to all work fine when on horizontal B, and from what
you've said it does. FYI for the vertical menu I'd use entryLevel
Then when on A simply change the menu slightly
[globalVar = TSFE:id= uid_of_A ]
SECONDMENU {
enrtyLevel>
special = list
special.value = uid_B
}
[global]
Does that solve it for you?
Daniel Rutzen
2009-10-02 09:58:37 UTC
Permalink
Hello Tyler,

I read the TSref. I know how to display the second level items in a menu.
Like I said, the menu itself works per se, but not on that certain page.

Are you REALLY sure, that
special = list
special.value = X
gives out the subpages of page X as well ?!?

Because, this is my TS, and it only displays one item: page uID 82.
and TSref doesn't say much about subpages with special = list either!
(thats why i am here :D )

[globalVar = TSFE:id = 19]
lib.leftmenu = COA
lib.leftmenu{

5 = HMENU
5 {

wrap = <ul id="secondmenu"> | </ul>
entryLevel = 0 [tried -2,-1,0,1,2, no change]
special = list
special.value = 82

1=TMENU
1.NO.wrapItemAndSub = <li>|</li>
1.NO.ATagTitle.field = description // subtitle // title

1.ACT=1
1.ACT.wrapItemAndSub = <li>|</li>
1.ACT.ATagTitle.field = description // subtitle // title

#show sub menu
2 = TMENU
2.wrap = <ul>|</ul>
2.NO.wrapItemAndSub = <li>|</li>
2.NO.ATagTitle.field = description // subtitle // title

#CUR Zustand der 2ten Ebene
2.CUR = 1
2.CUR < .2.NO
2.CUR.ATagParams = class="activeleft"

}

}
[GLOBAL]

I also tried special = directory, but that gives only subpages, and not
the parent item... :-/
Post by Tyler Kraft
Really? Build a second level to the menu.
The same way that SECONDMENU.1=TMENU displays the first menu level
simply use SECONDMENU.2=TMENU to show the second level. There might be
other properties that you need to specifically use depending upon the TS
and the page structure, but I have no idea as you've helpfully actually
not posted either of those.
I hate to say it but you need to read TSref, as it has everything in it
that you need. Look at HEMNU, TMENU and TMENUITEM
hth
Tyler Kraft
2009-10-02 12:13:33 UTC
Permalink
Hi Daniel,
Post by Daniel Rutzen
Are you REALLY sure, that
Yes I'm REALLY REALLY sure ;-)
Christopher Torgalson
2009-10-02 16:08:28 UTC
Permalink
Hi,
Post by Daniel Rutzen
Hello Tyler,
I read the TSref.
Possibly, but you didn't read it carefully. Your TS contains an error
that is very clearly mentioned by the TSref [1]:

"NOTE: Don't set .entryLevel for a HMENU when using this [.special] option!"

Moreover, the TSref also explicitly mentions (in the same paragraph!)
how submenus are created when the .special property is used:

"Also be aware that this selects pages for the first level in the
menu. Submenus by menuPbjects [sic] 2+ will be created as usual."

I don't know if your simultaneous use of .entryLevel and .special is
the source of your problems, but it's definitely the most obvious
error in your code.

[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/8/#id4251386
Post by Daniel Rutzen
I know how to display the second level items in a menu.
Like I said, the menu itself works per se, but not on that certain page.
Are you REALLY sure, that
special = list
special.value = X
gives out the subpages of page X as well ?!?
Because, this is my TS, and it only displays one item: page uID 82.
and TSref doesn't say much about subpages with special = list either!
(thats why i am here :D )
[globalVar = TSFE:id = 19]
lib.leftmenu = COA
lib.leftmenu{
? ?5 = HMENU
? ?5 {
? ? ? wrap = <ul id="secondmenu"> | </ul>
? ? ? entryLevel = 0 ? [tried -2,-1,0,1,2, no change]
? ? ? special = list
? ? ? special.value = 82
? ? ? 1=TMENU
? ? ? 1.NO.wrapItemAndSub = <li>|</li>
? ? ? 1.NO.ATagTitle.field = description // subtitle // title
? ? ? 1.ACT=1
? ? ? 1.ACT.wrapItemAndSub = <li>|</li>
? ? ? 1.ACT.ATagTitle.field = description // subtitle // title
? ? ? #show sub menu
? ? ? 2 = TMENU
? ? ? 2.wrap = <ul>|</ul>
? ? ? 2.NO.wrapItemAndSub = <li>|</li>
? ? ? 2.NO.ATagTitle.field = description // subtitle // title
? ? ? #CUR Zustand der 2ten Ebene
? ? ? 2.CUR = 1
? ? ? 2.CUR < .2.NO
? ? ? 2.CUR.ATagParams = class="activeleft"
? ?}
}
[GLOBAL]
I also tried special = directory, but that gives only subpages, and not
the parent item... :-/
--
Christopher Torgalson
http://www.typo3apprentice.com/
Daniel Rutzen
2009-10-02 23:23:10 UTC
Permalink
NO.
I only put it there, because I was told to. (I asked somewhere else as
well).

But, as I mentioned below, I solved the problem! :-)
Post by Christopher Torgalson
Hi,
Post by Daniel Rutzen
Hello Tyler,
I read the TSref.
Possibly, but you didn't read it carefully. Your TS contains an error
"NOTE: Don't set .entryLevel for a HMENU when using this [.special] option!"
Moreover, the TSref also explicitly mentions (in the same paragraph!)
"Also be aware that this selects pages for the first level in the
menu. Submenus by menuPbjects [sic] 2+ will be created as usual."
I don't know if your simultaneous use of .entryLevel and .special is
the source of your problems, but it's definitely the most obvious
error in your code.
[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/8/#id4251386
Post by Daniel Rutzen
I know how to display the second level items in a menu.
Like I said, the menu itself works per se, but not on that certain page.
Katja Lampela
2009-10-01 14:59:26 UTC
Permalink
lib.leftmenu = COA
lib.leftmenu {
10 = TEXT
10.data = leveltitle:2
10.wrap = <div id="your-menu-header-class">|</div>

# Leftside Navigation
20 = HMENU
20.entryLevel = 2
20.1 = TMENU
20.1 {
noBlur = 1
wrap = <ul>|</ul>
ACT = 1
CUR = 1
and blah blah...

}
}

this example I gave you provides what you are looking for - it is the
vertical submenu. You only have to play with the entryLevel (the actual
submenu) and the leveltitle (the header of the menu and this would be
your 1st level horizontal menu's chosen page) to fit your site's needs.

With kind regards

Katja Lampela
*Lieska-tuotanto
* www.lieska.net
Post by Daniel Rutzen
I have a horizontal MAINMENU main A | main B | main C
I have a vertical SECONDMENU ("leftmenu") on the left, which shows the
title of the current main item, and below it displays the subpages of
the current main-page.
main A (which is also a link to 'main A' again)
- subpage A1
- subpage A2
- subpage A3
main B (which is also a link to 'main B' again)
- subpage B1
- subpage B2
- subpage B3
<ul id="leftmenu">
<li><a href="main A.html">main A</a>
<ul>
<li><a href="subpage_A1.html">subpage A1</a>
<li><a href="subpage_A2.html">subpage A2</a>
<li><a href="subpage_A3.html">subpage A3</a>
</ul>
</li>
</ul><!-- end leftmenu -->
To This point, it all works!!! that's not the issue.
On Page "Main A" I want the leftmenu to display the pages
corresponding to page "Main B".
So, "Main A" must show in the leftmenu
main B (which is also a link to the same page)
- subpage B1
- subpage B2
- subpage B3
Katja Lampela
2009-10-01 15:03:35 UTC
Permalink
sorry, after reading you post to the end (below) actually I don't quite
understand what you are after..
- Katja
Post by Daniel Rutzen
On Page "Main A" I want the leftmenu to display the pages
corresponding to page "Main B".
So, "Main A" must show in the leftmenu
main B (which is also a link to the same page)
- subpage B1
- subpage B2
- subpage B3
Daniel Rutzen
2009-10-02 10:49:04 UTC
Permalink
solved it:

Had to enter expAll=1 to the first level entry in the menu.
Like this:

1=TMENU
1.expAll=1
1.NO.wrapItemAndSub = <li>|</li>



I always put it before the level configuration, like this:

5 = HMENU
5 {
wrap = <ul id="secondmenu"> | </ul>
special = list
special.value = 82
entryLevel >
expAll=1

which did not work!

So, maybe this helps somebody else.. :-)
Loading...