nil2567 Posted August 30, 2012 Share Posted August 30, 2012 hello everybody, Is there a way to edit css inside tpl or php module file that change the front end? I need to pass php variables from DB to the css. I know how to get the DB values and I need to pass to a css file. Ex: if in tpl file I do: <style> background{black} all the front end will desapear and be black and I don't understand why. </style> any help please Link to comment Share on other sites More sharing options...
coeos.pro Posted August 30, 2012 Share Posted August 30, 2012 try with: <style type="text/css"> body{ background-color: black; } </style> body, or html, or #your_id or .your_class... 1 Link to comment Share on other sites More sharing options...
Dh42 Posted August 30, 2012 Share Posted August 30, 2012 You will have to get the value from the database and pass it to smarty. Your final output should be something like this. style="background: {$color.value};" 1 Link to comment Share on other sites More sharing options...
nil2567 Posted August 30, 2012 Author Share Posted August 30, 2012 thanks!!! worked like a charm. another question, if you please: how do you call diferente files? for exemplo a tpl file. if I want to call a file2.tpl two diferents tpl files Link to comment Share on other sites More sharing options...
Dh42 Posted August 30, 2012 Share Posted August 30, 2012 You do it with includes {include file="$tpl_dir./breadcrumb.tpl"} Link to comment Share on other sites More sharing options...
nil2567 Posted August 30, 2012 Author Share Posted August 30, 2012 thanks you thank you thank you that is what a prefer but I liked your code: $this->display(__FILE__, 'ourcontent.tpl'); Link to comment Share on other sites More sharing options...
Recommended Posts