[TYPO3-english] Flexible menu starting points

JoH asenau info at cybercraft.de
Tue Jul 22 22:05:59 CEST 2014


> special.value.field = checkbox_value // parent_page_checkbox_value //
> grandparent_page_checkbox_value // grandgrandparent_page_checkbox_value
>
> So, if checkbox value on J page is null then check value of checkbox on
> page G (parent). If that one is also null then check grandparent
> checkbox value on page F. If that one is null then check one on page C.
> Number of level would be fixed, for example to 4.
>
> If this idea is not too stupid how can i get field values from parent
> page levels? Thx!

What you want is called "levelfield" and is part of the getText methods 
of the data property.

special.value.data = levelfield:-1, myfieldname, slide

levelfield says: I want to check a field in the rootline of the current page

You can have positive values, which would be counted as static levels 
starting at the root page. So levelfield:2 would be starting at level 2. 
But you can use negative values as well, which would be counted as 
relative levels backwards from the current page. So -1 would be the 
current page, -2 the parent and so on.

Then you have to name the field you want to check. Additionally you 
should make sure, it will be added to the so called "rootline fields", 
since the method will be available for registered fields only. You can 
do so in the appropriate section of the install tool.

The slide option will make levelfield start at the given level and then 
check for an existing value of that field down the rooltine until a 
value will be found or the root page is reached. Is there a value on 
page J? No? - OK, check page G and so on.

Since it might be possible that there is no value at all, you should use 
a fallback.

special.value.ifEmpty = 123

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


More information about the TYPO3-english mailing list