Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Have two commenting systems

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 419
Location: Kathmandu, Nepal

PostPosted: Sat Apr 24, 2010 1:08 am    Post subject: Have two commenting systems Reply with quote

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.
Code:
<!--{* ... *}-->
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.
_________________
Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 419
Location: Kathmandu, Nepal

PostPosted: Tue Jun 22, 2010 7:38 pm    Post subject: Remove HTML comment residues Reply with quote

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!
_________________
Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7038
Location: Lincoln Nebraska, USA

PostPosted: Tue Jun 22, 2010 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 419
Location: Kathmandu, Nepal

PostPosted: Tue Jun 22, 2010 8:31 pm    Post subject: It works Reply with quote

Prefilter works!

Thanks.
_________________
Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP