【问题标题】:Change header color multistore prestashop更改标题颜色多商店 prestashop
【发布时间】:2017-01-13 06:20:42
【问题描述】:

我使用带有多商店选项的 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"}测试

但标题中没有任何变化

【问题讨论】:

    标签: colors prestashop-1.6 multistore


    【解决方案1】:

    在你的 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;
    }
    

    【讨论】:

    • 我已经完成了所有的更改,并在 globla css 中添加了 css:.shop_pro.header-top { background-color: red!important;} 但没有任何改变
    • 我有同样的问题,我清除所有缓存(prestashop 和浏览器)
    【解决方案2】:

    中间有空格会更好

    .shop_pro .header-top {
        background: red;
    }
    

    【讨论】:

    • 是的,我有这个 跨度>
    【解决方案3】:

    这样更好,在

    之间有空格
    .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">
    

    【讨论】:

      【解决方案4】:

      店名应该是这样的

      <body id="index" class="index my_store hide-left-column hide-right-column lang_en">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-10-16
        • 2015-12-04
        • 1970-01-01
        • 2021-01-04
        • 1970-01-01
        • 1970-01-01
        • 2022-07-24
        • 2017-08-19
        相关资源
        最近更新 更多