[TYPO3] Unable to get the correct register: value!

Surer Dink surerlistmail at gmail.com
Sat Feb 25 23:44:26 CET 2006


Peter,
  I can assure you the menu code works and properly displays either
two or three menus on screen, depending on how many levels are there
(lib.menus.30.2 is not always visible).  Modifying the line:
  cObject.dataWrap = 100/{register:myCounter}
to read
  cObject.dataWrap = 100/{register:counter_menuItems}
rseults in a computed value in the header, however naturally the count
is taken from the wrong menu.
  This suggests to me that I am hitting either a bug or a feature of
templavoila - since you do not appear to be using it and are getting
the expected results.  It is evident that the LOAD_REGISTER construct
is not worknig as you expect it to.  This far, this experience has
driven me up the wall - since it's now 3 days and I still do not have
such a simple thing working.  (and you, amongst others, have
explicitly told me that the code I am showing is correct.)  Do you
have any suggestions for how I can proceed?  Is templavoila a piece of
crap and should I dump it now before it causes me more headache?  Or
am I just an idiot and using it wrong?


On 2/25/06, Peter Klein <peter at umloud.dk> wrote:
> Hi Surer. There's no easy way of debugging TS code, except analyzing the
> code and use the TS Object Browser.
> But my guess is that your menu code is somhow incorrect, as I tested the
> updated code I posted earlier, and it showed the correct percentage in the
> CSS code..
>
> Or it could be because that on the page you are testing it, the menu is not
> present, which results in the register value not being set.
> To fix that problem, you could extend the headerDate part with a check on
> where the register value is set or not. Like this:
>
> page.headerData.10.if.isTrue.data = register:myCounter
>
> --
> Peter Klein / Umloud Untd
>
> "Surer Dink" <surerlistmail at gmail.com> wrote in message
> news:mailman.4397.1140900956.3122.typo3-english at lists.netfielders.de...
> Peter,
>   Thank you for trying to help.  I have moved the lib.menus.35 to
> page.headerData.10 , however the header continues to show ERROR:
> divide by zero instead of the correct value.  Do you have any other
> suggestions for me to try?  What mechanisms exist of debugging such
> problems?
>
> (what I am trying to do - I have a menu styled as horizontal tabs, I
> want to resize them depending on the number of tabs present to take up
> 100% of the design's width, so if there are 2 tabs, each would be 50%
> wide, if there are 4, 25%, and so on)
>
>
> On 2/25/06, Peter Klein <peter at umloud.dk> wrote:
> > 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.
> >
> >
> > _______________________________________________
> > TYPO3-english mailing list
> > TYPO3-english at lists.netfielders.de
> > http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
> >
>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>



More information about the TYPO3-english mailing list