phunsanit Posted October 24, 2014 Share Posted October 24, 2014 how to used Global Smarty Variables in content like <img src="{$base_dir}/img/{$content_id}/cover.png"> 1 Link to comment Share on other sites More sharing options...
vekia Posted November 4, 2014 Share Posted November 4, 2014 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 More sharing options...
FullCircles Posted November 4, 2014 Share Posted November 4, 2014 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)} 1 2 Link to comment Share on other sites More sharing options...
Recommended Posts