Documentation Center

Context Engine Cartridge custom tags, server controls and TCDL tags

You can include code in your Web page that interacts with aspect properties.

context:if
LanguageCommand
ASP.NET server control (requires Context Expression Extension)<context:if runat="server">
JSP custom tag (requires Context Expression Extension)<context:if>
TCDL tag<tcdl:if>
Attribute nameDescription
expressionA valid CEL expression

Use this tag to check if an expression evaluates to true or to false, and to render or not render content based on that fact.

For example, to only show a link to your app to visitors accessing your site from a mobile device, include the following in your template code:

<tcdl:if expression="device.mobile">
  Instead of using our Web site, why not <a href="http://www.example.com">download our app</a>?
</tcdl:if>

When publishing to JSP or ASP.NET, this tag is transformed into a context:if tag that the Context Expression Extension can handle.

context:eval
LanguageCommand
ASP.NET server control (requires Context Expression Extension)<context:eval runat="server">
JSP custom tag (requires Context Expression Extension)<context:eval>
TCDL tag<tcdl:eval>
Attribute nameDescription
expressionA valid CEL expression

Use this tag to render the result of the expression specified in its expression attribute.

For example, you can include the following in your templating code:

<tcdl:eval expression="'Greetings, ' + browser.model + ' user!'"/>

When publishing to JSP or ASP.NET, this tag is transformed into a context:eval tag that the Context Expression Extension can handle.

At request time, a visitor using Google Chrome will see the text "Greetings, Chrome user!"