|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Wed Mar 14, 2012 9:53 am Post subject: Good design preview mode in IDEs for Smarty tags (no noise) |
|
|
Some of the smarty template tags like {if}, {foreach}, ... will noise in the IDE's design preview mode.
Just wrap such tags with html commenting <!-- and -->.
And they will vanish. It will add a minor extra output (blank html comments), but is ok than to noise the design preview mode.
You can remove those comment wrappers at production level or just leave them there.
For example look at the the two codes.
Old noisy code:
Code: | <h1>Block 3</h1>
<div class="details">
{section name='b3' loop=$block3}
<div class="holder">
<div class="title">Choice {$block3[b3].priority_id}</div>
<div class="content">
<p>{$block3[b3].course}</p>
</div>
</div>
{sectionelse}
<p>No courses chosen in this block.</p>
{/section}
</div> |
And the clean code for design preview mode is:
Code: | <h1>Block 3</h1>
<div class="details">
<!--{section name='b3' loop=$block3}-->
<div class="holder">
<div class="title">Choice {$block3[b3].priority_id}</div>
<div class="content">
<p>{$block3[b3].course}</p>
</div>
</div>
<!--{sectionelse}-->
<p>No courses chosen in this block.</p>
<!--{/section}-->
</div> |
Interesting? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|