0
votes

In my TYPO3 6.2.31 (I know...) page I have the following typoscript for the navigation:

NAVIMAIN = HMENU
NAVIMAIN.entryLevel = 0
#NAVIMAIN.excludeUidList = 

NAVIMAIN {
1 = TMENU
1 {
expAll = 1
wrap = <ul class="sf-menu">|</ul>
noBlur = 1

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

ACT = 1
ACT.wrapItemAndSub = <li class="active"> |</li>  

 }

2 = TMENU
2 {
expAll = 1
maxItems = 10
wrap = <div class="sf-mega">|</div>
NO = 1
NO {
  ATagTitle.field = title
  wrapItemAndSub = <div class="sf-mega-section">|</div>
  stdWrap.wrap = |
  ATagParams =  class="headermega"
  stdWrap.htmlSpecialChars = 1
  doNotLinkIt = 0
  }
}

3 = TMENU
3 {
expAll = 1
maxItems = 20
wrap = <ul>|</ul>
NO = 1
NO {
  ATagTitle.field = title
  linkWrap = <li>|</li>
}
ACT = 1
ACT {
  wrapItemAndSub = <li>|</li>
  ATagParams =  class="active"
}
}
#4 < .3

}

All sub pages are marked as aktive when they are clicked ... but the root node not ... so I've added this as well:

[globalVar = TSFE:id=1]
    NAVIMAIN.alwaysActivePIDlist = 1
[global]

[globalVar = TSFE:id=1]
    NAVIMAIN.alwaysActivePIDlist = 60
[global]

But this does hasn't any effect as well.

What can I do to mark the root node as active as well?

Thanks in advance

2
Perhabs define CUR state as well. (remove the conditions). Perhabs the Root page a real page or a Shortcut to first subpage.NextThursday
can you give me an example with CUR ? Root page with id=1 is a real page ... Page with id=60 is a shortcut to page with id=1Felix
copy and paste ACT and call it CUR. However... ROOT page is never ever active as the first level is BELOW root. A navigation is a menu of pages which are subpage of ROOTNextThursday
That would be entryLevel -1NextThursday
negative entrylevel have a connection to current level: entryLevel = -1 is current level, entrylevel = -2 is the level above current level, ...Bernd Wilke πφ

2 Answers

2
votes

If you want both pages to be active you need to do another construct as in your way the second assignement would overwrite the first one.

[globalVar = TSFE:id=1]
    NAVIMAIN.alwaysActivePIDlist := addToList(1)
[global]

[globalVar = TSFE:id=1]
    NAVIMAIN.alwaysActivePIDlist := addToList(60)
[global]

In general you would join the two statements.

Another change I would consider: use another condition as TSFE will become obsolete in the near future:

[page:uid = 1]
    NAVIMAIN.alwaysActivePIDlist = 1,60
[global]
2
votes

After some Teamviewer investigations we found the source of the problem in the Typoscript structure. The [globalVar] condition was placed inside page.20.marks {} but conditions must be placed outside of any nesting.

Moving the condition outside of the nesting and correcting the path, everything worked fine.

[globalVar = TSFE:id=1]
    page.20.marks.NAVIMAIN.alwaysActivePIDlist = 60
[global]

As Bernd said, [page:uid = 1] would be the better condition, too.