|
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: Sat Apr 24, 2010 1:08 am Post subject: Have two commenting systems |
|
|
I want to have two commenting system in Smarty. Is it possible? How? Waiting for your replies and solutions. Here is my case:
The HTML commenting <!-- ... --> and Smarty's Commenting {* ... *} are both good for me. Sometimes, I need to use both the commenting system together as below. One reason is to show html comments, other is the comment on the template itself.
or/and
Code: | <!-- ... {* ... *} ... --> |
Once everything is okay, it would be better to make <!-- and --> as Smarty's commenting so that the page does not show any comments there. And, I do not want to change the left/right { and }. Because, this may corrupt the working copies of template variables/functions etc. by mistake.
Help me please. |
|
Back to top |
|
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Tue Jun 22, 2010 7:38 pm Post subject: Remove HTML comment residues |
|
|
This is to remove the HTML comments residues along with Smarty's comments.
Code: |
..THIS BLOCK IS INSIDE A LOOP!
<tr>
<td>S.N.</td>
...
<!--{* Name Headers *}-->
<td>{$name}</td>
...
</tr> |
Here, the comment: Name Headers is important to appear on the template. Smarty-only comments would trouble the designer tool like Dreamwever. So, I used a combination of HTML Comments as well.
But it leaves the space residues of empty html comments - which is somewhat serious for too big data.
Your helps required! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jun 22, 2010 7:42 pm Post subject: |
|
|
Use a prefilter to change your custom comment syntax to Smarty comment syntax.
<!--{* ... *}-->
changes to
{* ... *}
Code: | $input = str_replace(array('<!--{*','*}-->'),array('{*','*}'),$input); |
|
|
Back to top |
|
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Tue Jun 22, 2010 8:31 pm Post subject: It works |
|
|
Prefilter works!
Thanks. |
|
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
|