Documentation · ViewHelper reference

XSD schema file | vhs master

Condition / Context / IsFrontendViewHelper

Condition: Is context Frontend?

A condition ViewHelper which renders the then child if current context being rendered is FE.

Examples

<!-- simple usage, content becomes then-child -->
<v:condition.context.isFrontend>
    Hooray for BE contexts!
</v:condition.context.isFrontend>
<!-- extended use combined with f:then and f:else -->
<v:condition.context.isFrontend>
    <f:then>
       Hooray for BE contexts!
    </f:then>
    <f:else>
       Maybe BE, maybe CLI.
    </f:else>
</v:condition.context.isFrontend>

/

  • Tag usage example

    <v:condition.context.isFrontend then="[mixed]" else="[mixed]" condition="1">
    	<!-- tag content - may be ignored! -->
    </v:condition.context.isFrontend>
  • Inline usage example

    {v:condition.context.isFrontend(then: [mixed], else: [mixed], condition: 1)}

Arguments

Argument Description Type
condition

Condition expression conforming to Fluid boolean rules

boolean
else

Value to be returned if the condition if not met.

mixed
then

Value to be returned if the condition if met.

mixed
Required attribute

Revision history

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit f16494865266f00f4df185236b7856aa96841039
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sat Jun 7 22:58:04 2014 +0200

    [TASK] Replace old namespace and move v:if to v:condition and v:var to v:variable in documentaion and readme

commit 35093985593c408ed087e149990b3749624f870e
Author: Claus Due <*****@namelesscoder.net>
Date:   Fri Oct 10 15:14:52 2014 +0200

    [TASK] Refactor and cover Condition / Context scope with tests

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to license.md file