Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty {comment} tag?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
deadbyte
Smarty n00b


Joined: 04 Dec 2006
Posts: 1

PostPosted: Mon Dec 04, 2006 9:48 pm    Post subject: Smarty {comment} tag? Reply with quote

you know what Smarty needs? a way to comment out Smarty code in the template files so nothing gets processed by Smarty or displayed in HTML source.

<!-- Smarty code in this comment tag is still processed and viewable in HTML source! -->

if such a thing exists... I couldn't find it!

thanks!
Back to top
View user's profile Send private message
reb
Smarty Rookie


Joined: 17 Aug 2005
Posts: 23

PostPosted: Mon Dec 04, 2006 9:55 pm    Post subject: It exists Reply with quote

Code:
{* A Smarty comment *}


Last edited by reb on Wed May 05, 2010 10:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
shannera
Administrator


Joined: 13 Feb 2006
Posts: 802
Location: Edertal, Germany

PostPosted: Tue Dec 05, 2006 8:26 am    Post subject: Reply with quote

It seems you haven't really seen the content listing of the manual, the first chapter in II.3: http://smarty.php.net/manual/en/language.basic.syntax.php#language.syntax.comments
Back to top
View user's profile Send private message
ResonanceDesigns
Smarty n00b


Joined: 05 May 2021
Posts: 2

PostPosted: Wed May 05, 2021 8:58 pm    Post subject: Reply with quote

I looked at the documentation but how would one comment a part of the actual Smarty syntax out. For example, say I wanted to comment out the strip_tags argument in the below example:

{$event.desc|strip_tags|substr:0:200|trim}

I don't want to remove that argument, I just want to comment it out.

I tried {$event.desc|* strip_tags| *substr:0:200|trim} which did not work and completely broke the page.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Thu May 06, 2021 4:51 am    Post subject: Reply with quote

What I do is this:
Code:
{*
Was: {$event.desc|strip_tags|substr:0:200|trim}
Now: {$event.desc|substr:0:200|trim}
Date: 5 May 2021
Reason: Issue #9876, Branch #6A
*}
{$event.desc|substr:0:200|trim}
Back to top
View user's profile Send private message
ResonanceDesigns
Smarty n00b


Joined: 05 May 2021
Posts: 2

PostPosted: Thu May 06, 2021 9:19 am    Post subject: Reply with quote

Excellent, that's an elegent solution that also provides context to the other devs. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development 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