[TYPO3] How to overwrite HMENU?

Bing Du bdu at iastate.edu
Wed Jul 19 22:40:24 CEST 2006


Hi Johannes,

Johannes Konert wrote:
> Hi Bing,
> 
>> The HMENU of page1 is like the following in the main template.
> 
> 
>> temp.nav.10 = HMENU
>> temp.nav.10 {
> 
> 
> I suggest using entryLevel for the HMENU as well
>  temp.nav.10.entryLevel = 1 (or whatever)
> 
>> The following is the extension template I created for page2 in the 
>> hope to erase temp.nav and reconstruct it to show the menu starting 
>> from page2.  But the menu on page2 is still the same as that on page1.
> 
> 
> I think that is, because first the template of page1 is processed. There 
> you use the temp.nav (which is still the old one) somewhere like
> page = PAGE
> page.20 < temp.nav
> 
> or whatever.
> Afterwards the subtemplate is processed,
> temp.nav is changed but never again used.
> Maybe it helps to set some page.xx < temp.nav in your subtemplate again, 
> but I am not very experienced with the templates cause I am mainly 
> developer and not user.
> 
>> temp.nav >  # get rid of the original content of temp.nav
>> temp.nav = COA
>> temp.nav.stdWrap.dataWrap = <div id="nav">|</div>
>> temp.nav.10 = HMENU
>>
>> temp.nav.10.special = list
>> temp.nav.10.special.value = 3117  # 3117 is page2's id.
> 
> 
> Why don't you use special = directory ? This will create a menu of all 
> subpages of the given uids. In your code you get only one menu-element.
> ..or even use the same menu like on the main-page, just set entryLevel 
> to a new value.

Thanks much for the help.

I added 'entryLevel' and 'list' to 'directory' for temp.nav.10.special. 
  Now the Setup of page2 is like this:

==
temp.nav.10 >

temp.nav.10 = HMENU
temp.nav.10.entryLevel = 2
temp.nav.10.special = directory
temp.nav.10.special.value = 3117

temp.nav.10 {
     wrap = <div id="navheader"></div><ul id="welcome">|</ul><div 
id="navfooter"></div>
     1 = TMENU
     1 {
          NO = 1
          NO.allWrap = <li>|</li>

          ACT = 1
          ACT {
               allWrap = <li>|</li>
               ATagParams = class="selected nocursor"
          }

          ACTIFSUB = 1
          ACTIFSUB {
             subst_elementUid = 1
             allWrap = <li>|<ul>
             wrapItemAndSub = |</ul></li>
             ATagParams = class="selected"
          }

          SPC = 1
          SPC.doNotShowLink = 1
          SPC.allWrap = <div class="divider">&nbsp;</div>

      }
      2 < .1
}
==

Again, the page tree is:

page1
    page2            # id 3117
       page31        # id 3118
       page32        # id 3119

But page2 still shows the menu of the main template.  Then I added the 
main template in 'include basis template' of page2.  Now the menu on 
page2 just shows 'page32'.  Since the left column of the main template 
contains more stuff (temp.nav.15, temp.nav.20) than the menu 
(temp.nav.10).  I just want to overwrite the menu part (temp.nav.10) and 
replace it with the list of subpages beneath page2.  My understanding 
(maybe misunderstanding) is typo3 collects all the templates (main, 
extended) first and process them altogether rather than process them one 
by one.  So the extended templates can have opportunity to redefine 
variables. Oh well, I guess it's manual reading time again.

Bing



More information about the TYPO3-english mailing list