Megamenu follow-ups: nav_hide honoured, entries insertable, page tiles

- getMenu() treats hidden/time/fe_group as enable fields but NOT
  nav_hide - the treeColumns doc comment claimed otherwise, and the
  news detail page ("article") stayed in the new spotlight rail after
  the editor hid it in menus. All three getMenu() calls (spotlight nav,
  pagetree columns and their items) now pass 'AND nav_hide = 0';
  verified live (6 rail items)
- all four tx_evomegamenujson_* tables get
  security.ignorePageTypeRestriction: they are inline children of the
  menu plugin and live on whatever page the plugin sits on - creating
  a new entry on the standard page failed with "table is not allowed"
- new vitec:attach-page-media --root=<slug> (dry-run by default):
  attaches the numbered placeholder pages/<pid>-08.png (slot 08 = page
  media / menu tile, the number doubles as the image wish list) as page
  media to every child page without one; existing media is never
  touched. Run for /support (8 pages) so the planned Support menu entry
  renders as two 4-tile rows via the pagetree layout's column images

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Fable 5 committed 2026-10-27 12:08:26 +01:00
1 parent 6423b7c7f8
commit 8497dad06a
6 files changed
+153 -7

No files matched your search

@@ -39,6 +39,9 @@ final class MenuBuilder
private const TABLE_ITEM = 'tx_evomegamenujson_item';
private const TABLE_TEASER = 'tx_evomegamenujson_teaser';
/** getMenu() does not filter "hide in menus" by itself. */
private const NAV_WHERE = 'AND nav_hide = 0';
private const DEFAULT_SETTINGS = [
'stage' => 3,
'pendingBehaviour' => 'fallback',
@@ -208,8 +211,11 @@ final class MenuBuilder
/**
* Columns from the page tree below the entry's linked page. getMenu()
* applies the frontend restrictions (hidden, time, nav_hide, fe_group),
* so an editor hides a page and it leaves the menu with the next flush.
* applies the frontend restrictions (hidden, time, fe_group); nav_hide
* is NOT an enable field and goes through the additional where clause
* (found 2026-10-27 - the news detail page stayed in the spotlight
* rail). An editor hides a page and it leaves the menu with the next
* cache flush.
*
* @return array<int,array<string,mixed>>
*/
@@ -220,9 +226,9 @@ final class MenuBuilder
return [];
}
$columns = [];
foreach ($this->pageRepository->getMenu($rootUid) as $child) {
foreach ($this->pageRepository->getMenu($rootUid, '*', 'sorting', self::NAV_WHERE) as $child) {
$items = [];
foreach ($this->pageRepository->getMenu((int)$child['uid']) as $grandchild) {
foreach ($this->pageRepository->getMenu((int)$child['uid'], '*', 'sorting', self::NAV_WHERE) as $grandchild) {
$items[] = [
'title' => (string)(($grandchild['nav_title'] ?? '') !== '' ? $grandchild['nav_title'] : $grandchild['title']),
'link' => $this->url('t3://page?uid=' . (int)$grandchild['uid'], $cObj),
@@ -250,8 +256,7 @@ final class MenuBuilder
/**
* Flat left-rail nav for the spotlight layout: the linked page's children
* with abstract and page media, so the front end can render the rail and
* swap the visual area on hover. Same visibility rules as treeColumns
* (getMenu applies hidden, time, nav_hide and fe_group).
* swap the visual area on hover. Same visibility rules as treeColumns.
*
* @return array<int,array<string,mixed>>
*/
@@ -262,7 +267,7 @@ final class MenuBuilder
return [];
}
$items = [];
foreach ($this->pageRepository->getMenu($rootUid) as $child) {
foreach ($this->pageRepository->getMenu($rootUid, '*', 'sorting', self::NAV_WHERE) as $child) {
$item = [
'title' => (string)(($child['nav_title'] ?? '') !== '' ? $child['nav_title'] : $child['title']),
'link' => $this->url('t3://page?uid=' . (int)$child['uid'], $cObj),