[TYPO3] Unable to get the correct register: value!
Peter Klein
peter at umloud.dk
Sat Feb 25 21:20:47 CET 2006
Hi Surer. Im not quite sure I know what it is you want to do, but I shuffled
your code areound a bit, in order to get it to create the CSS header stuff
you need..
Here's the updated code:
-- cut --
temp.amenu = TMENU
temp.amenu {
noBlur = 1
NO {
allWrap = <li>|</li>
stdWrap.htmlSpecialChars = 1
ATagParams = class="lb" |*| class="im"
}
ACT < .NO
ACT=1
ACT.ATagParams = class="lb active" |*| class="im active"
}
}
}
lib.menus = COA
lib.menus {
10 = HMENU
10 {
entryLevel = 1
1 < temp.amenu
1.wrap = <ul id="nav">|</ul>
}
20 = LOAD_REGISTER
20.myCounter.data = register:count_menuItems
30 = HMENU
30 {
entryLevel = 2
1 < temp.amenu
1.wrap = <ul id="tree">|</ul>
2 < temp.amenu
2.wrap = <ul>|</ul>
}
}
# Default PAGE object:
page = PAGE
page.10 < lib.menus
page.headerData.10 = TEXT
page.headerData.10 {
cObject = TEXT
cObject.dataWrap = 100/{register:myCounter}
prioriCalc = 1
wrap = <style type="text/css">/*<![CDATA[*/ ul#nav li { width: |
%; }/*]]>*/</style>
}
-- cut --
"Surer Dink" <surerlistmail at gmail.com> wrote in message
news:mailman.4380.1140894231.3122.typo3-english at lists.netfielders.de...
Peter,
Per your recommendation, I have made the following changes (please
confirm this is all I should have done):
1) made an extra object under lib = COA
2) changed string names of nav, tree, and friends to integers
3) added LOAD_REGISTER intermediate
My code now looks like this:
lib.menus = COA
lib.menus {
10 = HMENU
10 {
entryLevel = 1
1 < temp.amenu
1.wrap = <ul id="nav">|</ul>
}
20 = LOAD_REGISTER
20.myCounter.data = register:count_menuItems
35 = TEXT
35 {
cObject = TEXT
cObject.dataWrap = 100/{register:myCounter}
prioriCalc = 1
wrap = <style type="text/css">/*<![CDATA[*/ ul#nav li { width: |
%; }/*]]>*/</style>
}
30 = HMENU
30 {
entryLevel = 2
1 < temp.amenu
1.wrap = <ul id="tree">|</ul>
2 < temp.amenu
2.wrap = <ul>|</ul>
}
}
...
page.headerData.1 < lib.menus.35
As a result, the page header now contains:
<style type="text/css">/*<![CDATA[*/ ul#nav li { width:ERROR: dividing
by zero%; }/*]]>*/</style>
Please advise.
More information about the TYPO3-english
mailing list