[TYPO3-english] Typoscript: only if page has sub pages

Dawid Pacholczyk dpacholczyk at gmail.com
Thu Jun 17 09:47:29 CEST 2010


sorry for wrong email guys :)

rofl my bad

2010/6/17 JoH asenau <info at cybercraft.de>:
>>> page.100 = TEXT
>>> page.100.data = field:title
>>>
>>> But I need it only if the current page has children pages.
>>>
>>> Is there any data field or condition that can make this work??
>>
>> TEXT has stdWrap. So you can use "if". "if" has "ifTrue", which is a
>> stdWrap, so it has "cObject". You can make that "cObject" as
>> "RECORDS" to with "selectFields" as "COUNT(*)" and without any where
>> because "pidInList" defaults to "this". So you'll get a number of
>> subpages as a result. "ifTrue" will check if it is non-zero and "if"
>> will let your title to be out based on that condition.
>
> Actually it's "isTrue" - and pidInList/selectFields has nothing to do with RECORDS but with "select" which is available for CONTENT and numRows ;-)
> Usually numRows has been made for counting items. In this case selectFields will be automatically set/overriden with COUNT(*)
>
> So this should do the job
>
> if.isTrue.numRows {
>    table = pages
> }
>
> 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
> Xing: http://contact.cybercraft.de
> Twitter: http://twitter.com/bunnyfield
> TYPO3 cookbook (2nd edition): http://www.typo3experts.com
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>



-- 
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)


More information about the TYPO3-english mailing list