Skip to content

Instantly share code, notes, and snippets.

@sta1r
Created June 12, 2013 13:25
Show Gist options
  • Select an option

  • Save sta1r/5765210 to your computer and use it in GitHub Desktop.

Select an option

Save sta1r/5765210 to your computer and use it in GitHub Desktop.

Revisions

  1. sta1r renamed this gist Jun 12, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. sta1r created this gist Jun 12, 2013.
    15 changes: 15 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?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>" />