ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Block echo in php

May 12, 2010 5:20pm

Subscribe [1]
  • #1 / May 12, 2010 5:20pm

    Joe Wolin

    206 posts

    Is it possible to do a block level echo when using php in templates?

    <? if ($total_results>1) {
          echo "<h4 class='interest_title'>Related Interests</h4>";
          echo "<ul class='interest_tags'>";
          echo "{exp:simpletag:related_tags tagname='{segment_3}' orderby='weight' sort='desc' weblog='profiles'}";
          echo "<li><a href="http://{path=community/search/}{segment_3}+{tagname}">{tag} ({weight})</a></li>";
          echo "{/exp:simpletag:related_tags}";
          echo "</ul>";
          }?>

    would like to clean this sort of thing up a bit…

  • #2 / May 12, 2010 5:37pm

    ender

    1644 posts

    <?php if ($total_results > 1) { ?>
        lorem ipsum
        ...
        ...
    <?php } ?>

    or

    <?php if ($total_results > 1) : ?>
        lorem ipsum
        ...
        ...
    <?php endif; ?>

    http://ca3.php.net/manual/en/control-structures.alternative-syntax.php

  • #3 / May 12, 2010 5:38pm

    Joe Wolin

    206 posts

    Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases