typo3 - Fluid condition with ContainsViewHelper -


i use condition in fluid template:

<f:if condition="{settings.image.classname} == 'lightbox'">                 <f:then>                     ....do                 </f:then>          <f:else>           <f:if condition="{settings.image.classname} !== 'lightbox'">                 <f:then>                  ....do else                 </f:then>          </f:if>          </f:else> 

it works fine if $settings.image.classname" "lightbox container" instead of "lightbox" not work of course. unfortunately not know how write condtion checks if $settings.image.classname contains "lightbox" or not.

the instructions found here: viewhelper reference .however not know how apply that.

add top of partial/content element

{namespace v=fluidtypo3\vhs\viewhelpers} 

and change logic this

<v:condition.string.contains haystack="{settings.image.classname}" needle="lightbox">    <f:then>         ....do    </f:then>    <f:else>         ....do else    </f:else> </v:condition.string.contains> 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -