我使用带有multistore选项的prestashop 1.6.1.2。
我想更改每个商店的标题颜色。
我使用相同的主题,因为复制不适用于当前主题。
在header.tpl中,我添加了:
if {$shop_name=="myshop"} {literal}<style> .header-top { background-color: #d6644a; }</style>{/literal}{/if}我使用if {$id-shop=="3"}进行测试
但标头中没有任何更改
发布于 2016-09-06 14:22:40
在您的header.tpl中更改此部分
<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{else} show-left-column{/if}{if $hide_right_column} hide-right-column{else} show-right-column{/if}{if isset($content_only) && $content_only} content_only{/if} lang_{$lang_iso}">将商店的名称包含在body类中。
<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($shop_name) && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')} {$shop_name|lower|replace:' ':'_'}{/if}{if isset($body_classes) && $body_classes|@count} {implode value=$body_classes separator=' '}{/if}{if $hide_left_column} hide-left-column{else} show-left-column{/if}{if $hide_right_column} hide-right-column{else} show-right-column{/if}{if isset($content_only) && $content_only} content_only{/if} lang_{$lang_iso}">然后在你的css中你可以使用
.my_store .header {
background: red;
}发布于 2016-09-06 16:06:42
更好的方式是使用空格
.shop_pro .header-top {
background: red;
}发布于 2016-09-06 18:17:45
这种方式更好,中间有空格
.my_store .header {
background: red;
}查看你的页面源代码。店名应该和店名差不多
<!--[if IE 8]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body id="index" class="index my_store hide-left-column hide-right-column lang_en">https://stackoverflow.com/questions/39338046
复制相似问题