Jump to content

Main CMS Categorie ID


gniewko

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...