• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Smarty not processing when in text field
PostPosted: Thu May 18, 2017 8:10 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 24, 2011 12:37 am
Posts: 75
I have a custom module that stores items.
I'm editing a Description field with cms_textarea enablewysiwyg=true
and adding {get_template_vars} in the body (for example).
When the field is pulled it shows the literal {get_template_vars} text without processing smarty.
Is there something i'm missing?
thanks


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Smarty not processing when in text field
PostPosted: Thu May 18, 2017 8:19 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7805
Location: Fernie British Columbia, Canada
A textarea is just a text area. that's it.

If you want to treat it like a template in your module, then you need to pass it through smarty.

Code:
$tpl = $smarty->CreateTemplate('string:'.$the_text_area_content);
// assign some smarty variables here.
// i.e:  $tpl->assign('foo',$foo);
$output = $tpl->fetch();
// or optionally $tpl->display();


BTW. It is not advisable for security purposes to do this for content that is edited on a public facing page.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Smarty not processing when in text field
PostPosted: Thu May 18, 2017 8:52 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 24, 2011 12:37 am
Posts: 75
Thanks calguy1000,
i was reasoning correctly, was missing the execution.
The editing is happening in the admin area so i assume security is not compromised.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
cron
HostPapa CMS Made Simple hosting