[TYPO3] how to get Page Number using TS?

JoH asenau info at cybercraft.de
Tue Jan 23 00:46:02 CET 2007


> 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!

Just to complete this: You might want to check the sorting of your menu and
this CONTENT element. They should be the same.

Usually HMENU is using the "sorting" field, so it could be useful to have

select {
    pidInList.field = pid
    orderBy = sorting
}

or maybe another field than sorting if you are using the HMENU property
alternativeSortingField.

HTH

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