Jump to content

[RESOLU] Afficher le titre de la page CMS dans le breadcrumb.tpl


Recommended Posts

voici le code du fichier breadcrumb.tpl :

 

<div class="bread-top">
{if isset($profile_params.leobcimg) && ($profile_params.leobcimg || $profile_params.breadcrumb.bgcolor)}
  <div data-depth="{$breadcrumb.count}" class="breadcrumb-bg {$profile_params.breadcrumb.textposition} {if $profile_params.breadcrumb.bgfull}breadcrumb-full{/if}" style="{if $profile_params.breadcrumb.bgcolor} background-color:{$profile_params.breadcrumb.bgcolor};{/if}{if $profile_params.breadcrumb.use_background}background-image: url({if $page.page_name == 'category' && $profile_params.breadcrumb.category == 'catimg' && isset($category.image.large.url) && $category.image.large.url != ''}{$category.image.large.url}{else if $profile_params.leobcimg}{$profile_params.leobcimg}{/if});{/if}{if $profile_params.breadcrumb.height} min-height:{$profile_params.breadcrumb.height};{/if} ">
   
   <h1></h1> 
   
   {if isset($profile_params.breadcrumb.bgfull) && $profile_params.breadcrumb.bgfull}
    {/if}
    {if $page.page_name == 'category' }
      <h1 class="h1">{$category.name}</h1>
    {/if}
    <nav data-depth="{$breadcrumb.count}" class="breadcrumb hidden-sm-down">
    <ol>
        {block name='breadcrumb'}
          {foreach from=$breadcrumb.links item=path name=breadcrumb}
            {block name='breadcrumb_item'}
            <li>
              {if not $smarty.foreach.breadcrumb.last}
                <a href="{$path.url}"><span>{$path.title}</span></a>
              {else}
                <span>{$path.title}</span>
              {/if}
              </li>
            {/block}
          {/foreach}
        {/block}
      </ol>
    </nav>
    {if isset($profile_params.breadcrumb.bgfull) && $profile_params.breadcrumb.bgfull}
    </div>
    {/if}
  </div>
{else}
  {if $page.page_name == 'category'}
    {if !empty($category.image.large.url)}
        <div class="category-cover">
            <img src="{$category.image.large.url}" alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}" loading="lazy">
        </div>
    {/if}
    {else if $page.page_name == 'cms'}
      <div class="category-cover">
        <img src="{$urls.img_url}BRCC.jpg"  class="img-fluid" alt="Breadcrumb image">
      </div>

    {else if $page.page_name == 'contact'}
      <div class="category-cover">
        <img src="{$urls.img_url}BRCT.jpg"  class="img-fluid" alt="Breadcrumb image">
      </div>
    
    {else if $page.page_name == 'module-leoblog-blog' || $page.page_name == 'module-leoblog-category' || $page.page_name == 'module-leoblog-list'}

      <div class="category-cover">
        <img src="{$urls.img_url}BRCB.jpg"  class="img-fluid" alt="Breadcrumb image">
      </div>
    {else}
      <div class="category-cover">
      <img src="{$urls.img_url}BRCP.jpg"  class="img-fluid" alt="Breadcrumb image">
    </div>
  {/if}
  
  
  
  
  <div class="container">
    <nav data-depth="{$breadcrumb.count}" class="breadcrumb hidden-sm-down">
      <ol>
        {block name='breadcrumb'}
          {foreach from=$breadcrumb.links item=path name=breadcrumb}
            {block name='breadcrumb_item'}
              <li>
                {if not $smarty.foreach.breadcrumb.last}
                  <a href="{$path.url}"><span>{$path.title}</span></a>
                {else}
                  <span>{$path.title}</span>
                {/if}
              </li>
            {/block}
          {/foreach}
        {/block}
      </ol>
    </nav>
     {if $page.page_name == 'category' }
      <h1 class="h1">{$category.name}</h1>
    {else if $page.page_name == 'contact' }
      <h1 class="h1">{l s='Contact' d='Shop.Theme.Global'}</h1>
    {else if $page.page_name = 'cms'}
      {block name='page_title' hide}
        <header class="page-header">
          <h1>{$smarty.block.child}</h1>
        </header>
      {/block}
    {/if}
    
  </div>
{/if}
</div>

 

Link to comment
Share on other sites

bonjour,

j'ai beau essayer pleins de variantes ... je trouve pas ...

dans une page CMS, dans le fichier breadcrumb.tpl, je veux simplement afficher le titre H1 ...

c'est quoi le code ?

<h1 class="h1">{$page.page_title}</h1>

<h1 class="h1">{$page.title}</h1>

ne fonctionnent pas ...

<h1 class="h1">{$cms.id}</h1> me revoie bien l'id

mais <h1 class="h1">{$cms.title}</h1> me revoie rien

Link to comment
Share on other sites

Ce n'est pas le breadcrumb.tpl, de base de classic, il faut donc voir avec le développeur du thème les variables qu'il initialise.

Pour info le template de classic est le suivant:

<nav data-depth="{$breadcrumb.count}" class="breadcrumb">
  <ol>
    {block name='breadcrumb'}
      {foreach from=$breadcrumb.links item=path name=breadcrumb}
        {block name='breadcrumb_item'}
          <li>
            {if not $smarty.foreach.breadcrumb.last}
              <a href="{$path.url}"><span>{$path.title}</span></a>
            {else}
              <span>{$path.title}</span>
            {/if}
          </li>
        {/block}
      {/foreach}
    {/block}
  </ol>
</nav>

 

Link to comment
Share on other sites

  • Centaure changed the title to [RESOLU] Afficher le titre de la page CMS dans le breadcrumb.tpl

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...