# Fluid page rendering via PAGEVIEW (TYPO3 v14 pattern, ref: theme_camino)
lib.fluidPage = PAGEVIEW
lib.fluidPage {
    paths.10 = EXT:sflg_sitepackage/Resources/Private/PageView/

    dataProcessing {
        # Primary site nav (site-nav / menu overlay's primary column).
        10 = menu
        10 {
            as = mainMenu
            levels = 2
            expandAll = 1
            special = directory
            special.value = {$sflg.menu.mainPid}

            # Resolves each item's own "Media" field for the overlay's per-link
            # hover image. Items without their own media just have no image —
            # in favor of core's plain files processor).
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                    as = media
                }
            }
        }

        # Menu overlay's right-hand column — own root page, independent of
        # the footer nav (was reusing footerMenu before).
        20 = menu
        20 {
            as = secondaryMenu
            levels = 1
            special = directory
            special.value = {$sflg.menu.secondaryPid}
        }

        # Site footer's own nav (site-footer__nav) — independent of secondaryMenu above.
        30 = menu
        30 {
            as = footerMenu
            levels = 1
            special = directory
            special.value = {$sflg.menu.footerPid}
        }

        # Resolves the page's own "Media" field (pages.media) so og:image/
        # twitter:image can fall back to a per-page image instead of one
        # static default when editors haven't set og_image/twitter_image.
        40 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
        40 {
            references.fieldName = media
            as = pageMedia
        }

        # Routes content.main (and every other content area) through
        # content-blocks' AfterContentHasBeenFetchedEvent, which auto-excludes
        # IRRE Collection children (foreign_table_parent_uid != 0) from every
        # colPos site-wide — PAGEVIEW's default content-area assignment
        # dispatches no such event, so without this, a Collection field with
        # foreign_table=tt_content (e.g. the drawer's panel content) would
        # also render as a loose top-level element wherever its colPos points.
        50 = page-content
    }
}
