[TYPO3] how to get Page Number using TS?
JoH asenau
info at cybercraft.de
Wed Jan 24 00:26:32 CET 2007
>> 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!
>
> Thanks for the snippit Joey. It looks good, but I have not been able
> to get to output anything in my dev site.
>
> Is there maybe a static template or something that I should be
> including?
>
> What version of TYPO3 did you test that on, and got a working result?
> Is there a URL where I could take a look?
You don't have to include a static template to make it working, since this
is basic TypoScript that doesn't require anything like CSS-styled-content or
the like.
But I have to admit I didn't test it with TV but with a simple TS setup.
So the snippet is correct but maybe you have to tweak it a bit, since TV
handles pages differently.
Try this one:
lib.pageNumber = CONTENT
lib.pageNumber {
table = pages
select {
pidInList.data = page:pid
}
renderObj = TEXT
renderObj {
if.value.field = uid
if.equals.data = TSFE:id
data = cObj:parentRecordNumber
wrap = <yourwrap>|</goeshere>
}
}
HTH
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob 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