webbie1985 Posted December 23, 2013 Share Posted December 23, 2013 Hi guys, pretty much as the title says the code is below {if $cms->id==1} {literal} SCRIPT CODE HERE {/literal} {/if} what do i replace the $cms with. is it the .tpl name Thanks Merry Christmas Paul Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2013 Share Posted December 23, 2013 $cms is a variable generated by blockcms on left, right, footer hook... What to you want to do exactly? Which version are you using ? Link to comment Share on other sites More sharing options...
webbie1985 Posted December 23, 2013 Author Share Posted December 23, 2013 basically i have 4 javascripts to run, i need to run 1 of them that corresponds to the correct category if that makes sense. im running 1.5.6 thanks Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2013 Share Posted December 23, 2013 on category id 1? {if $category->id == 1} Link to comment Share on other sites More sharing options...
webbie1985 Posted December 23, 2013 Author Share Posted December 23, 2013 so i would use for example {if $category->==1} {literal} JAVASCRIPT {/literal} {/if} and change the number to the corresponding category id correct? thanks again Link to comment Share on other sites More sharing options...
doekia Posted December 23, 2013 Share Posted December 23, 2013 Yes if what you want is trigger the script on a specific category display >= may not be good, better use {if in_array($category->id, array(id1,id1,id3))} Link to comment Share on other sites More sharing options...
vekia Posted December 30, 2013 Share Posted December 30, 2013 hello if you want to display it only on selected category page, you can use something like: {if $smarty.get.id_category==2} HERE YOUR CODE {/if} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now