Skip to content

Instantly share code, notes, and snippets.

@sta1r
Created June 12, 2013 13:25
Show Gist options
  • Save sta1r/5765210 to your computer and use it in GitHub Desktop.
Save sta1r/5765210 to your computer and use it in GitHub Desktop.
Conditional logic in Site Manager
<?php
// PHP is useful for conditional logic where the HTML structure is very different - e.g.
$number_of_highlight_boxes = '<t4 type="content" name="Number of boxes" output="normal" modifiers="" />';
if ($number_of_highlight_boxes == "1") { /* write some HTML */ } else { /* write some more HTML */ }
?>
<!--
However there's a useful way in T4 to selectively output fields IF they contain data,
and wrap HTML around the data if it is output e.g.
-->
<t4 type="content" name="Box section title" output="selective-output" modifiers="" format="<h2>$value</h2>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment