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

Dmitry Dulepov dmitry.dulepov at gmail.com
Thu Jun 17 08:02:28 CEST 2010


Hi!

Tania Morales wrote:
> I need to show the current page title so I do this:
> 
> 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.

This is how I would try it.

-- 
Dmitry Dulepov
TYPO3 expert / TYPO3 core&security teams member
Twitter: http://twitter.com/dmitryd
Read more @ http://dmitry-dulepov.com/


More information about the TYPO3-english mailing list