|
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 |
deadbyte Smarty n00b
Joined: 04 Dec 2006 Posts: 1
|
Posted: Mon Dec 04, 2006 9:48 pm Post subject: Smarty {comment} tag? |
|
|
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 |
|
reb Smarty Rookie
Joined: 17 Aug 2005 Posts: 23
|
Posted: Mon Dec 04, 2006 9:55 pm Post subject: It exists |
|
|
Code: | {* A Smarty comment *} |
Last edited by reb on Wed May 05, 2010 10:34 pm; edited 1 time in total |
|
Back to top |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
|
Back to top |
|
ResonanceDesigns Smarty n00b
Joined: 05 May 2021 Posts: 2
|
Posted: Wed May 05, 2021 8:58 pm Post subject: |
|
|
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 |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Thu May 06, 2021 4:51 am Post subject: |
|
|
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 |
|
ResonanceDesigns Smarty n00b
Joined: 05 May 2021 Posts: 2
|
Posted: Thu May 06, 2021 9:19 am Post subject: |
|
|
Excellent, that's an elegent solution that also provides context to the other devs. 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
|