[SOLVED] Fallback page with Neos.Neos:Page

hi there,

How can I achieve this goal:

When I call “https://www.domain.de/collection/product-abc.html” it calls first a NEOS-Page “collection > product-abc” (regular way). If it does not exist, it should show a own plugin within the normal site template (and navigation).

I’ve added

name: 'Details view for Glasses'
uriPattern: 'collection/{urlPathSegment}.{@format}'
defaults:
    '@package':    'Namespace.Package'
    '@controller': 'Glasses'
    '@action':     'show'

to the Routes.yaml. This works - but it shows the clean plugin without the site template.

Hello Lars,

maybe not exactly what you are looking for but i would use a custom 404 page and the Package Sitegeist.Movealong (https://github.com/sitegeist/Sitegeist.MoveAlong) for things like that.

The package basically catches requests where no route matched and routes the request via fallback uri-pathes in that case. As default it will use the uri-path 404 as fallback as soon as it is enabled. You can change that and even define other pathes for special request patterns if you need to. That way the fallbacks can be created as normal documents by editors.

There are other packages for custom 404 pages around that might suit your needs better. I know about https://github.com/mocdk/MOC.NotFound but there were more.

Regards, Martin

2 Likes

works perfect, thanks you very much Martin!!!