[TYPO3] Unable to get the correct register: value!
Peter Klein
peter at umloud.dk
Sat Feb 25 14:03:13 CET 2006
Hi Surer. "count_menuItems" is a temp register value used by alle menus. It
gets reset everytime you create a new menu object on the page.
What you need to do, is store the value of "count_menuItems" in your own
register variable. That way it doesn't get reset when you have more than 1
menu object.
---
Peter Klein / Umloud Untd
"Surer Dink" <surerlistmail at gmail.com> wrote in message
news:mailman.4258.1140853622.3122.typo3-english at lists.netfielders.de...
All,
For about 2 days I've been trying to figure out how to get a register
value into PAGE.headerData - to no avail. The problem is that there are
multiple menus on the page, and I want to get the count_menuItems from a
particular one. Everything I have tried with LOAD_REGISTER has failed. The
code bellow works - however retrieves the incorrect menu's count (I want to
get the count for nav.1, it appears to get the count for tree.1 - I have no
idea why) [if there is a better way to do what I am trying, by all means
please enlighten me] Thank you.
temp {
amenu = TMENU
amenu {
noBlur = 1
ACT=1
NO {
allWrap = <li>|</li>
stdWrap.htmlSpecialChars = 1
ATagParams = class="lb" |*| class="im"
}
ACT {
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
ATagParams = class="lb active" |*| class="im active"
}
}
}
lib {
nav = HMENU
nav {
entryLevel = 1
1 < temp.amenu
1.wrap = <ul id="nav">|</ul>
}
nav_width = TEXT
nav_width {
cObject = TEXT
cObject.dataWrap = 100/{register:count_menuItems}
prioriCalc = 1
wrap = <style type="text/css">/*<![CDATA[*/ ul#nav li { width: | %;
}/*]]>*/</style>
}
tree = HMENU
tree {
entryLevel = 2
1 < temp.amenu
1.wrap = <ul id="tree">|</ul>
2 < temp.amenu
2.wrap = <ul>|</ul>
}
}
page = PAGE
page.headerData.1 < lib.nav_width
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page
More information about the TYPO3-english
mailing list