punktDe / sitespecifics

Site specific configuration for the Neos backend
MIT License
11 stars 3 forks source link

feature: use contentDimensionsByNameForSite eel helper for dimensions #7

Open adrian-cerdeira opened 1 month ago

adrian-cerdeira commented 1 month ago

Is it not possible to use the EEL-Helper also in Fusion to for example only show in an language menu allowed presets:

    @context.allowedPresetsForLanguage = ${Neos.Ui.Api.emptyArrayToObject(
        PunktDe.SiteSpecifics.SiteSpecificContentDimensions.allowedPresetsByNameForSite(
            documentNode.context.dimensions,
            site
        )
    )}

    renderer = Ongoing.Theme.Menu:Component.Menu {
        @context.menuItems = Neos.Neos:DimensionsMenuItems {
            dimension = 'language'
            presets = ${contentDimensions.allowedPresets['language']}
        }
adrian-cerdeira commented 1 month ago

It would just need in the settings this code:

Neos:
  Fusion:
    defaultContext:
      PunktDe.SiteSpecifics.SiteSpecificContentDimensions: \PunktDe\SiteSpecifics\Eel\SiteSpecificContentDimensionsHelper