Jump to content

[SOLVED] how to modify class style to one specific page on my prestashop site?


Recommended Posts

Check body class of desired category in your html source and make css classes according to that category.

 

So if your page class is :

<body id="category" class="category category-3 category-women hide-right-column lang_en">

style for left column bg would be something like that:

.category-3 #left_column{
    background:#000;
}
Link to comment
Share on other sites

 

Check body class of desired category in your html source and make css classes according to that category.

 

So if your page class is :

<body id="category" class="category category-3 category-women hide-right-column lang_en">

style for left column bg would be something like that:

.category-3 #left_column{
    background:#000;
}

 

Thanks dioniz! but my html source is:

<body id="category" class="category lang_es">

I dont know where is the category number

Link to comment
Share on other sites

in your header.tpl file use code like:

 

instead of simple:

<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if}">

use:

<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if isset($category)}category_{$category->id}{/if}{if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if}">

then each category page will have class category_X where X is the category ID

  • Like 1
Link to comment
Share on other sites

in your header.tpl file use code like:

 

instead of simple:

<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if}">

use:

<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if isset($category)}category_{$category->id}{/if}{if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if}">

then each category page will have class category_X where X is the category ID

 

Excelent! It works, thank u very much Vekia

Link to comment
Share on other sites

×
×
  • Create New...