Jump to content

Global Smarty Variables used in CMS Content


Recommended Posts

  • 2 weeks later...

it's not possbile to use these variables in CMS contents that you provide in tinymce editor

tinymce editor allows to use only static html / css code

this mean that you can't use there any "server side" scripts like smarty syntax, php etc.

 

 

you can only use smarty syntax in .tpl files.

Link to comment
Share on other sites

The closest thing you're likely to get is to set up a mini variable system for use in the CMS pages. Usually only useful if you're going to be using a variable a lot, like say the $base_dir variable

 

On your cms.tpl file, just find:

{$cms->content}

And change it to something like:

{str_replace(array('(BASE_DIR)'), array($base_dir), $cms->content)}

Then just enter (BASE_DIR) in your text editor code and it'll auto replace it on the front end.

 

You can add more by comma seperating them into the arrays, i.e.

{str_replace(array('(BASE_DIR)', '(CONTENT_ID)'), array($base_dir, $cms->id_cms), $cms->content)}
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

×
×
  • Create New...