Skip to content

Commit

Permalink
Add name breadcrumb for page
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick477 committed Jun 27, 2018
1 parent 6474b0c commit f94deca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/Entity/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,21 @@ public function setDescriptionWhenLinked(?string $descriptionWhenLinked): void
$this->getPageTranslation()->setDescriptionWhenLinked($descriptionWhenLinked);
}

/**
* {@inheritdoc}
*/
public function getNameBreadcrumb(): ?string
{
return $this->getPageTranslation()->getNameBreadcrumb();
}

public function setNameBreadcrumb(?string $nameBreadcrumb): void
{
$this->getPageTranslation()->setNameBreadcrumb($nameBreadcrumb);
}

public function getImage(): ?ImageInterface
{
return $this->getPageTranslation()->getImage();
}

/**
* {@inheritdoc}
*/
public function setImage(?ImageInterface $image): void
{
$this->getPageTranslation()->setImage($image);
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/PageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function getNameWhenLinked(): ?string;

public function setNameWhenLinked(?string $nameWhenLinked): void;

public function getNameBreadcrumb(): ?string;

public function setNameBreadcrumb(?string $nameBreadcrumb): void;

public function getDescriptionWhenLinked(): ?string;

public function setDescriptionWhenLinked(?string $descriptionWhenLinked): void;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ imports:
- { resource: services/repository.yml }
- { resource: services/importer.yml }
- { resource: services/resolver.yml }
- { resource: services/provider.yml }
- { resource: services/media_provider.yml }

parameters:
bitbag_sylius_cms_plugin.media_provider.interface: BitBag\SyliusCmsPlugin\Media\Provider\ProviderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Shop/Page/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="ui breadcrumb">
<a href="{{ path('sylius_shop_homepage') }}" class="section">{{ 'sylius.ui.home'|trans }}</a>
<div class="divider"> /</div>
<div class="active section">{{ page.name }}</div>
<div class="active section">{{ page.nameBreadcrumb }}</div>
</div>
<div class="ui segment">
<h1 class="ui dividing header bitbag-page-name">{{ page.name }}</h1>
Expand Down

0 comments on commit f94deca

Please sign in to comment.