Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Nov 16, 2023
1 parent 165057d commit e2f52e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
@@ -1,4 +1,4 @@

{#{{ blockWrapperAttr(block) }}#}
{{ block.data.style == 'unordered' ? '<ul>' : '<ol>' }}
{% for item in block.data.items %}
{% if item.content is defined %}
Expand Down
10 changes: 7 additions & 3 deletions packages/admin/src/Menu/PageMenuProvider.php
Expand Up @@ -43,8 +43,9 @@ public function getMenu(): ItemInterface
$menu = $factory->createItem('content', [
'label' => $this->translator->trans('admin.label.content'),
'route' => 'admin_page_list',
'name' => 'page',
])
->setCurrent(true) // dirty hack to prevent bug
// ->setCurrent(true) // dirty hack to prevent bug
// ->setExtra('keep_open', true)
->setExtra(self::ORDER_NUMBER, 1)
;
Expand All @@ -53,6 +54,7 @@ public function getMenu(): ItemInterface

$isRequesteingRedirection = $this->isRequestingRedirection();
if (\count($hosts) > 1) {
$pageMenu->setCurrent(true);
foreach ($hosts as $host) {
$hostMenu = $pageMenu->addChild($host, [
'route' => 'admin_page_list',
Expand All @@ -68,10 +70,12 @@ public function getMenu(): ItemInterface

$hostMenu->setCurrent(true);
}
} elseif ($this->isRequestingPageEdit() && ! $isRequesteingRedirection) {
$pageMenu->setCurrent(true);
}

// if ($this->isRequestingPageEdit() && ! $isRequesteingRedirection) {
// $pageMenu->setCurrent(true);
// }

$menu->addChild('admin.label.cheatsheet', ['route' => 'cheatsheetEditRoute']);

return $menu;
Expand Down
6 changes: 5 additions & 1 deletion packages/admin/src/templates/Menu/menu.html.twig
Expand Up @@ -11,5 +11,9 @@
{% do item.setAttribute('class', (item.getAttribute('class') ~ ' active')) %}
{% endif %}

{{ parent() }}
{% if item.name in ['page'] %}
{% do item.setAttribute('class', (item.getAttribute('class')|replace({'treeview':''}))) %}
{% endif %}

{{ parent()|preg_replace('@treeview(.*/admin/app/page/list)@', '$1')|raw }}
{% endblock %}

0 comments on commit e2f52e7

Please sign in to comment.