[TYPO3-english] Conditionnal display of a content element (Stefan Reichelt)

Edmund Huggett edmund at xact.uk.com
Tue Mar 19 12:31:05 CET 2013


On 19/03/13 10:21, aliasjcdenton at sunrise.ch wrote:
> Le 13.03.2013 12:00, typo3-english-request at lists.typo3.org a écrit :
>> Re: Conditionnal display of a content element (Stefan Reichelt)
> Thanks for the answer.
>
> Here are the different cases and what I wish to do
>
> I there are subpages, always display the subpages section (a content
> element displaying links to subpages)
>
> If the page is not empty, always display its contents (and after, the
> subpages section if there are subpages)
>
> If the page is empty and there are NO subpages, display a message
> mentionning that the page is in construction.
>
> If the page is empty and there are subpages, only display the subpages
> section (NO message mentionning that the page is in construction).
>
> Thank you by advance for your help !
>
> Kind regards
> alisjcdenton
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

Hi

Sorry might not be much help but i hope it will get you started. I have 
a single typoscript menu that shows the children/subpages of the current 
page or the siblings of the current page if there are no children.

# Menu 1 (siblings)
temp.siblingMenu=HMENU
temp.siblingMenu{
entryLevel=-2
1=TMENU
1.NO{
linkWrap=<liclass="square_red">|</li>
}
}

## Menu Two (children)
temp.childrenMenu<temp.siblingMenu
temp.childrenMenu{
entryLevel=-1
}

temp.switchMenu=COA
temp.switchMenu{
10<temp.siblingMenu
stdWrap.override.cObject<temp.childrenMenu

}

lib.additional_menu<temp.switchMenu


It works very roughly as follows,
1. create a menu of siblings / pages on the same level
2. create a menu of children / subpages of the current page
3. (temp.switchMenu) copy in the contents of the sibling menu
4. (temp.switchMenu) overwrite the existing menu with the contents of 
the children menu, but if this object has no value (no children / 
subpages) then it will have no effect leaving the original menu as the 
value.
5. Assign the temp object to the real typoscript path i use for this menu.

Best of luck; I can't help much further!

Regards

Edmund


More information about the TYPO3-english mailing list