[TYPO3-english] override if on menu object

Mikel lists at con-version.com
Tue Nov 17 09:47:17 CET 2015


I found out myself.
Here is the solution (without "or" in condition)

### create the override as COA
tmp.sectionIndexMenuOverride = COA
tmp.sectionIndexMenuOverride{
     10 >
     20 = FLUIDTEMPLATE
     20.file = {$templatesBasePath}/Content/SectionMenu.html
}

### store the original menu object into another object
tmp.originalMenu < tt_content.menu

### flush the TS from css styled content
tt_content.menu >

### override menu object and assign original menu, override it when db 
field is set to TRUE
tt_content.menu = COA
tt_content.menu {
     10 < tmp.originalMenu
     10.stdWrap.override.cObject < tmp.sectionIndexMenuOverride
     10.stdWrap.override.cObject.if.isTrue.field = 
section_menu_respect_grid_container
}

> Hi all,
>
> I want to render a section menu with a fluid template when several 
> conditions are true.
>
> Therefor I added two new fields as boolean to the database:
> 1. name_of_field_1
> 2. name_of_field_2
>
> Now I want to render the section menu (menu type = 3) with fluid if 
> one of the two new fields are true.
>
> So I would need an or condition and and override on the cObject.
>
> I tried that way, but without result:
>
> # First, I copy the menu object to a temporary object to attach the 
> original cObject if no override should be done
> tmp.menuObject < tt_content.menu.20
>
> tmp.myOverride = COA
> tmp.myOverride {
>     10 = TEXT
>     10.value = this has been overwritten
> }
>
> # then I override the menuobject into a COA to proove conditions
> tt_content.menu.20 = COA
> tt_content.menu.20 {
>     # now I attach the original resource again
>     10 < tmp.menuObject
>     10.override < tmp.myOverride
>     10.override.if {
>         isTrue.field = name_of_field_1
>     }
> }
>
> The result is, that the original resource is rendered. So my if 
> condition seems not to match.
>
> Questions:
>
> Can I override the rendering of a menu type into a fluid template?
> Can I check more then just one field in the override condition with "or"?
>
> Thanks in advance
>
> Mikel
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list