gniewko Posted October 2, 2012 Share Posted October 2, 2012 Hi, I wanted to use a dedicated css depending on the (main) cms category in which they are located. I found two variables: $ category-> id which contains the current categories and $ category-> id_parent which contains the categories of priority. The problem is that it needs to use a variable that contains the main categorie If CMS has categories cms - Home 1 - Subcategory 1 - Under the category 1 - Under the category 2 Home 2 in sub-paragraph 1 and under the categories 1 and 2, I would like to get the id of the Home 1 category Some suggestions? Regards Link to comment Share on other sites More sharing options...
gniewko Posted October 5, 2012 Author Share Posted October 5, 2012 Hi, I worked it out in such a way: <div class="side-box side-information{if $path|strstr:'id_cms_category=12' or $category->id == '12'} teams-view"> <img src="/themes/jarex/gfx/mapka.png" alt="" class="map-bg"> {elseif $path|strstr:'id_cms_category=7' or $category->id == '7'} teams-view"> <img src="/themes/jarex/gfx/mapka.png" alt="" class="map-bg"> {else}"> {/if} check if in $path is the main category and if current category is main. Maybe you can do it in any other "nicer" way but it works ... Regards 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