[TYPO3] how to get Page Number using TS?

JoH asenau info at cybercraft.de
Tue Jan 23 00:41:49 CET 2007


>> lib.pageNumber = TEXT
>> lib.pageNumber.value = 11
>> into the setup field does output the number 11 as expected.
>
> Then you should try this one:
>
> lib.pageNumber = TEXT
> lib.pageNumber.data = TSFE:id
>
> HTH

Sorry - overlooking the part "I don't want the PID ..."
BTW: It's not the pid but the uid since pid means parent_id and not page_id
;-)

But you could do something else:

lib.pageNumber = CONTENT
lib.pageNumber {
    table = pages
    select {
        pidInList.field = pid
    }
    renderObj = TEXT
    renderObj {
        if.value.field = uid
        if.equals.data = TSFE:id
        data = cObj:parentRecordNumber
        wrap = <yourwrap>|</goeshere>
    }
}

This will take all the (visible) pages on the same level as the current
page.
It will render the current value of cObj:parentRecordNumber (which is the
counter of all the items inside a CONTENT element) but only if the uid of
the rendered page is the same as the uid of the current page (which can be
found in TSFE:id)

Tested and working!

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list