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
Smarty not processing when in text field
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Smarty not processing when in text field
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.
BTW. It is not advisable for security purposes to do this for content that is edited on a public facing page.
If you want to treat it like a template in your module, then you need to pass it through smarty.
Code: Select all
$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();
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.
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.
Re: Smarty not processing when in text field
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.
i was reasoning correctly, was missing the execution.
The editing is happening in the admin area so i assume security is not compromised.