Skip to content

Commit 4e9e448

Browse files
author
wladyslaw.dudko@gmail.com
committed
added excludeFromNav option
1 parent 0a67a06 commit 4e9e448

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/Entity/Page/Page.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ class Page implements TranslatableInterface, BlameableInterface, TimestampableIn
9292
*/
9393
private ?string $template = null;
9494

95+
/**
96+
* @var bool
97+
* @ORM\Column(type="boolean")
98+
*/
99+
private bool $excludeFromNav = false;
100+
95101
public function __construct()
96102
{
97103
$this->children = new ArrayCollection();
@@ -335,4 +341,20 @@ public function setTemplate(?string $template): void
335341
{
336342
$this->template = $template;
337343
}
344+
345+
/**
346+
* @return bool
347+
*/
348+
public function isExcludeFromNav(): bool
349+
{
350+
return $this->excludeFromNav;
351+
}
352+
353+
/**
354+
* @param bool $excludeFromNav
355+
*/
356+
public function setExcludeFromNav(bool $excludeFromNav): void
357+
{
358+
$this->excludeFromNav = $excludeFromNav;
359+
}
338360
}

src/Form/PageType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
139139
'label' => $this->translator->translate('page.redirect'),
140140
'help' => $this->translator->translate('page.redirect_help')
141141
])
142+
->add('excludeFromNav', ToggleChoiceType::class,[
143+
'label' => $this->translator->translate('page.excludeFromNav'),
144+
'help' => $this->translator->translate('page.excludeFromNav_help')
145+
])
142146
->add('buttons', SaveButtonsType::class);
143147
}
144148

src/translations/messages.pl.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ page:
1515
redirect: Przekierowanie
1616
redirect_help: Ustawienie przekierowania nie zmienia linku do danej podstrony! Należy korzystać z tej funkcjonalności tylko w razie konieczności.
1717
template: Szablon
18+
excludeFromNav: Wykluczyć z nawigacji
19+
excludeFromNav_help: Zaznaczenie tej opcji spowoduje brak wyświetlania danej podstrony w nawigacji (breadcrumbs, menu)
1820
role:
1921
role_page_view: Strony (przeglądanie)
2022
role_page_edit: Strony (edycja)

0 commit comments

Comments
 (0)