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

strip between beta and production site

 
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 -> General
View previous topic :: View next topic  
Author Message
shinn
Smarty n00b


Joined: 07 May 2014
Posts: 2

PostPosted: Wed May 07, 2014 1:48 am    Post subject: strip between beta and production site Reply with quote

i want to do {strip} on production site only, but the code seems fail.
<{if $deploy == 'PUBLIC'}>
<{strip}>
<{/if}>
some html code
<{if $deploy == 'PUBLIC'}>
<{/strip}>
<{/if}>

it will do strip when $deploy = 'beta'
Back to top
View user's profile Send private message
bluejester
Smarty Regular


Joined: 26 Apr 2012
Posts: 55

PostPosted: Wed May 07, 2014 12:21 pm    Post subject: Reply with quote

You'd better do this on PHP side.

Remove your {strip} in your TPL.
In your PHP, add something like this :
Code:

if ($deploy == 'PUBLIC')
   $smarty->loadFilter('output', 'trimwhitespace');
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu May 08, 2014 4:06 am    Post subject: Reply with quote

{strip} is no runtime tag and stripping is done when the template gets compiled.

Using the output filter is the better choice.
Back to top
View user's profile Send private message
shinn
Smarty n00b


Joined: 07 May 2014
Posts: 2

PostPosted: Thu May 08, 2014 6:44 am    Post subject: Reply with quote

thanks, it's working.
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 -> General 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