[TYPO3] menu - how to count and display included subpages?
tapio
tapio.markula at dnainternet.net
Wed Jan 4 13:44:18 CET 2006
rene wrote:
> Peter Klein wrote:
>
>>Hi rene. it's close.. Take a look at this stand-alone example..
>>
>>-- cut --
>>lib.test = COA
>>lib.test {
>>
>> # Save the output of numRows in the registervalue: "menuNumber"
>> 10 = LOAD_REGISTER
>> 10.menuNumber.numRows {
>> table = pages
>> select.pidInList.data = field:uid
>> }
>>
>> # Retrieve the registervalue and display it.
>> 20 = TEXT
>> 20.dataWrap = <div>There are {register:menuNumber} subpages to the page:
>>{field:title}</div>
>>
>>}
>>
>>page.30 < lib.test
>>-- cut --
>>
>
> hello peter.
>
> thank you for the example. but it doesn't solve the main problem i have
> - how to get the data into the TMENU and inside the link. i tried to
> copy the data from lib.test into NO with:
>
> NO < lib.test
>
> or
>
> NO.dataWrap < lib.test
>
> but didn't get it to work. in the documentation there is no sentence how
> the link is build, so i could jump between. only how to wrap around
> something but that's not my problem.
>
> could you help me once again?
AFAIK {register:menuNumber} and {field:somefield}
works only with datawrap.
I tryed to use it outside, but it simple doesn't work.
something.allWrap =<div id="{field:somefield}">...
is rendered AS SUCH and and the source code of the page renders the wrap
as you have defined it witout parsing {field...}
I can put something BEFORE using datawrap.
something.dataWrap = <div>There are {register:menuNumber} subpages to
the page: {field:title}|</div>
BUT that creates an independent block OUTSIDE the link
If you let it open (no </div>)
something.dataWrap = <div>There are {register:menuNumber} subpages to
the page: {field:title}|
you can put before link anything you want.
The termination is then in some other wrap, for example 'allWrap' has
extra </div>
Alternative you build the WHOLE link using datawrap
something.dataWrap = <div><a href="/{field:uid}/">{field:title}
{register:menuNumber}|</a></div>
More information about the TYPO3-english
mailing list