gatheck Posted May 30, 2014 Share Posted May 30, 2014 Salut j'aimerais savoir comment ajouter une nouvelle class au body sous Prestashop 1.5. mercie d'avance Link to comment Share on other sites More sharing options...
S-HAMMANI Posted May 30, 2014 Share Posted May 30, 2014 Bonjour Tu peux modifier le fichier tpl appelé themes/ton-theme/header.tpl tu cherches à la ligne 67 le code suivant: <body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if $hide_left_column}hide-left-column {/if} {if $hide_right_column}hide-right-column {/if} {if $content_only} content_only {/if}"> et le remplacer par: <body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if $hide_left_column}hide-left-column {/if} {if $hide_right_column}hide-right-column {/if} {if $content_only} content_only {/if} nouvelleClasse"> Link to comment Share on other sites More sharing options...
gatheck Posted May 30, 2014 Author Share Posted May 30, 2014 Mercie Link to comment Share on other sites More sharing options...
gatheck Posted May 30, 2014 Author Share Posted May 30, 2014 Merci pour ton aide. Pour être plus précis, j'aimerais ajouter une nouvelle classe au body en fonction de la page courant (index, product, category...) sous prestashop 1.5 Link to comment Share on other sites More sharing options...
jd440 Posted June 5, 2014 Share Posted June 5, 2014 Rien de plus simple. il suffit d'adapter ce que disais S-HAMMANI <body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if $hide_left_column}hide-left-column {/if} {if $hide_right_column}hide-right-column {/if} {if $content_only} content_only {/if} {if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}"> Link to comment Share on other sites More sharing options...
gatheck Posted June 5, 2014 Author Share Posted June 5, 2014 #jd440 je viens de tester ce que tu viens de me dire. ça marche mais j'ai un petit soucis. Au niveau pages category et product (il en existe plusieurs) la classe reste la même (category dans les pages catégory et product dans les pages produits). Comment faire varié la classe en étant par exemple dans category1, category2 ou bien product7, product10..... Cordialement; Link to comment Share on other sites More sharing options...
S-HAMMANI Posted June 6, 2014 Share Posted June 6, 2014 Bonjour: Voile une petit ajout à tester: <body{if isset($page_name)} id="{$page_name|escape:'html':'UTF-8'}"{/if} class="{if isset($page_name)}{$page_name|escape:'html':'UTF-8'}{/if}{if isset($body_classes) && $body_classes|@count} {implode value=$body_classes separator=' '}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if} lang_{$lang_iso} {if isset($category)} categorie{$category->id}{/if}{if isset($product)} produit{$product->id}{/if}"> Resulta pour un teste d'un des produits demo ps 1.6: class="product product-3 product-printed-dress category-9 category-casual-dresses hide-left-column hide-right-column lang_en categorie9 produit3" 1 Link to comment Share on other sites More sharing options...
gatheck Posted June 6, 2014 Author Share Posted June 6, 2014 mercie #S-HAMMANI ça fonctionne 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