New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow developers to add items to breadcrumb from tpl #8474

Merged
merged 1 commit into from Nov 14, 2017

Conversation

Projects
None yet
2 participants
@kpodemski
Contributor

kpodemski commented Nov 7, 2017

Questions Answers
Branch? develop
Description? sometimes we need to add additional items to breadcrumb from .tpl, not controller, especially when we use some legacy modules which not support new breadcrumb mechanism
Type? improvement
Category? FO
BC breaks? no
Deprecations? no
Fixed ticket? no
How to test? try to add breadcrumb to manufacturers page or contact page directly by editing their tpl file not controller

Important guidelines


This change is Reviewable

@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91

Quetzacoalt91 Nov 7, 2017

Member

Hi @kpodemski,

Have you tried to use a whole {block} around the breadcrumb and use the append, prepend functions of smarty? This could also cover the case where a theme developer needs to add content before it.

Member

Quetzacoalt91 commented Nov 7, 2017

Hi @kpodemski,

Have you tried to use a whole {block} around the breadcrumb and use the append, prepend functions of smarty? This could also cover the case where a theme developer needs to add content before it.

@kpodemski

This comment has been minimized.

Show comment
Hide comment
@kpodemski

kpodemski Nov 7, 2017

Contributor

Hi, we need code in ol tag so your idea is good but I guess not what we needed

Contributor

kpodemski commented Nov 7, 2017

Hi, we need code in ol tag so your idea is good but I guess not what we needed

@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91

Quetzacoalt91 Nov 7, 2017

Member

Well, you could still fit your needs like this:

<nav data-depth="{$breadcrumb.count}" class="breadcrumb hidden-sm-down">
  <ol itemscope itemtype="http://schema.org/BreadcrumbList">
    {block name='breadcrumb'}
      {foreach from=$breadcrumb.links item=path name=breadcrumb}
        {block name='breadcrumb_item'}
          <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a itemprop="item" href="{$path.url}">
              <span itemprop="name">{$path.title}</span>
            </a>
            <meta itemprop="position" content="{$smarty.foreach.breadcrumb.iteration}">
          </li>
        {/block}
      {/foreach}
    {/block}
  </ol>
</nav>
Member

Quetzacoalt91 commented Nov 7, 2017

Well, you could still fit your needs like this:

<nav data-depth="{$breadcrumb.count}" class="breadcrumb hidden-sm-down">
  <ol itemscope itemtype="http://schema.org/BreadcrumbList">
    {block name='breadcrumb'}
      {foreach from=$breadcrumb.links item=path name=breadcrumb}
        {block name='breadcrumb_item'}
          <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a itemprop="item" href="{$path.url}">
              <span itemprop="name">{$path.title}</span>
            </a>
            <meta itemprop="position" content="{$smarty.foreach.breadcrumb.iteration}">
          </li>
        {/block}
      {/foreach}
    {/block}
  </ol>
</nav>
@kpodemski

This comment has been minimized.

Show comment
Hide comment
@kpodemski

kpodemski Nov 7, 2017

Contributor

Yes, this seems better

Contributor

kpodemski commented Nov 7, 2017

Yes, this seems better

@kpodemski

This comment has been minimized.

Show comment
Hide comment
@kpodemski

kpodemski Nov 8, 2017

Contributor

@Quetzacoalt91 ok, done

Contributor

kpodemski commented Nov 8, 2017

@Quetzacoalt91 ok, done

@Quetzacoalt91

Sounds good to me obviously :)

@Quetzacoalt91 Quetzacoalt91 added this to the 1.7.4.0 milestone Nov 14, 2017

@Quetzacoalt91 Quetzacoalt91 merged commit 9ccc411 into PrestaShop:develop Nov 14, 2017

2 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91
Member

Quetzacoalt91 commented Nov 14, 2017

Thank you @kpodemski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment