在手机的面包屑导航中隐藏最后一个文本块-Prestashop

时间:2018-11-21 09:51:32

标签: javascript html css mobile prestashop

我想移动手机上的面包屑导航中隐藏最后一个文本块

示例(在产品页面上):

Notebooky>Adaptéryknotebookům>Adaptérynáhradní> Nabíječkana notebook acer 19v 3.42a(5.5x1.7)

我正在尝试使其看起来像这样:

Notebooky>Adaptéryknotebookům>Adaptérynáhradní

我已经尝试了一些CSS,Javascript和编辑breadcrumb.tpl,但我不知道面包屑是如何制成的。

有人可以帮忙吗?谢谢。

Prestashop面包屑代码为:

<!-- Breadcrumb -->
{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}
<div class="breadcrumb clearfix {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}fullwidth-breadcrumb{/if}">
    {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}<div class="container">{/if}
        <a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}"><i class="icon-home"></i></a>
    {if isset($path) AND $path}
        <span class="navigation-pipe"{if isset($category) && isset($category->id_category) && $category->id_category == (int)Configuration::get('PS_ROOT_CATEGORY')} style="display:none;"{/if}>{$navigationPipe|escape:'html':'UTF-8'}</span>
        {if $path|strpos:'span' !== false}
            <span class="navigation_page">{$path|@replace:'<a ': '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" '|@replace:'data-gg="">': '><span itemprop="title">'|@replace:'</a>': '</span></a></span>'}</span>
        {else}
            {$path}
        {/if}
    {/if}

        {if $page_name == 'product'}
        {hook h='productnavs'}
        {/if}

{if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}</div>{/if}
</div>

<!-- /Breadcrumb -->

这是Prestashop生成的HTML代码

<div class="breadcrumb clearfix "> 
  <a class="home" href="https://powerparts.cz/" title="Zpět na hlavní stránku">
    <i class="icon-home"></i></a> 
  <span class="navigation-pipe">&gt;
  </span> 
  <span class="navigation_page">
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
      <a itemprop="url" href="https://powerparts.cz/457-notebooky/" title="Notebooky">
        <span itemprop="title">Notebooky
        </span></a>
    </span>
    <span class="navigation-pipe">&gt;
    </span>
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
      <a itemprop="url" href="https://powerparts.cz/50-adaptery-k-notebookum/" title="Adaptéry k notebookům">
        <span itemprop="title">Adaptéry k notebookům
        </span></a>
    </span>
    <span class="navigation-pipe">&gt;
    </span>Nabíječka na notebook acer 19v 3.42a (5.5x1.7)
  </span>
  <div id="productsnavpn" class="pull-right">
  </div>
</div>

示例:https://i.imgur.com/VGbqRqg.png

enter image description here

1 个答案:

答案 0 :(得分:0)

假设您可以使用1.6或1.7方法,这是一个潜在的解决方案(我不知道$ page_name =='product'之后的钩子中包含什么):

{if !isset($context)}
  {$context = Context::getContext()}
{/if}

<!-- Breadcrumb -->
{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}
<div class="breadcrumb clearfix {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}fullwidth-breadcrumb{/if}">
    {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}<div class="container">{/if}
        <a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}"><i class="icon-home"></i></a>
    {if isset($path) AND $path}
        <span class="navigation-pipe"{if isset($category) && isset($category->id_category) && $category->id_category == (int)Configuration::get('PS_ROOT_CATEGORY')} style="display:none;"{/if}>{$navigationPipe|escape:'html':'UTF-8'}</span>
        {if $path|strpos:'span' !== false}
            <span class="navigation_page">{$path|@replace:'<a ': '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" '|@replace:'data-gg="">': '><span itemprop="title">'|@replace:'</a>': '</span></a></span>'}</span>
        {elseif !$context->isMobile() && $page_name == 'product'}
            {$path}
        {/if}
    {/if}

        {if $page_name == 'product'}
        {hook h='productnavs'}
        {/if}

{if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}</div>{/if}
</div>

<!-- /Breadcrumb -->