Skip to content

Instantly share code, notes, and snippets.

@wisbey
Forked from sta1r/gist:5765210
Created September 17, 2013 10:01
Show Gist options
  • Save wisbey/6592356 to your computer and use it in GitHub Desktop.
Save wisbey/6592356 to your computer and use it in GitHub Desktop.
<?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