Hi,
For Neos password protected pages. When the login session is expired, users get a “Page Not Found” page. How do I customise this to include a log in form?
Thanks!
Rocky
Hi,
For Neos password protected pages. When the login session is expired, users get a “Page Not Found” page. How do I customise this to include a log in form?
Thanks!
Rocky
I didn’t test it yet, but I recently stumbled upon https://www.neos.io/download-and-extend/packages/sitegeist/sitegeist-movealong.html and it might help you
You can use https://www.neos.io/download-and-extend/packages/moc/moc-notfound.html and point to “login” instead of “404” if you like.
However it can’t differentiate between the page actually not existing and when a page cannot be accessed due to restrictions. That would require some custom code to achieve. You could fork the package and add the logic to it.
FYI: The fact that inaccessible & non-existing behaves the same was done on purpose in order to prevent information disclosure. Working around that might have an impact on the security of your system
How exactly it can point to login ? I am also using the package but I want to point to the page with URL segment to /notfound and I am struggling with the settings.yaml
I have the following settings in my Project/Configuration/Settings.yaml
error:
exceptionHandler:
renderingGroups:
notFoundExceptions:
options:
variables:
path: ‘404-2’
Error -> No controller could be resolved which would match your request.
I have the same problem at the moment.
(Using Neos v7.0.1)
I configured my Settings.yaml with:
Neos:
Flow:
error:
exceptionHandler:
renderingGroups:
notFoundExceptions:
matchingStatusCodes: [404]
options:
variables:
path: '404
And the error:
Seite nicht gefunden
Die angeforderte Seite konnte nicht gefunden werden.
#1303209195: No controller could be resolved which would match your request. Package key: “”, controller name: “Standard”. (GET http://localhost:8081/de/digitalergerg)
Is there any solution to this? I can’t find a proper way in the docs to handle Custom 404 Error pages, besides this link:
Where it only says:
By extending the
error
case you can add custom 404 rendering like in the example below.
But there are no examples.
Hi Daniel,
seems the code example was cut by doc generator. But you can find a current example in the Neos.Demo site https://github.com/neos/Neos.Demo/blob/master/Resources/Private/Fusion/Override/Error.fusion
Thanks.
It’s working now, but it took some more configuration (the following files):
/Resources/Private/Fusion/Document/NotFoundPage.fusion
/Resources/Private/Fusion/Override/Error.fusion
/Configuration/NodeTypes.Document.NotFoundPage.yaml
And adding the following to /Configuration/NodeTypes.Document.HomePage.yaml
childNodes:
'notfound':
type: 'Package.Name:Document.NotFoundPage'
Futherone, I changed something in Error.fusion:
@context.notfoundDocument = ${q(site).children('[instanceof Neos.Neos:Document]').filter('[uriPathSegment="notfound"]').get(0)}
Hope this helps other people with the same problem.
Hi Daniel,
great to hear it works for you now. I recommend to make the notfound page as autogenerated childnode of your homepage type (like in the Demo). This way you can use the original query again and editors cannot accidentally break the page by moving or changing the uriPathSegment.
For handling properly the i18n case, for example /fr/some/non-existent-page should return a French version of the NotFound page, I used the code provided here: https://github.com/neos/Neos.NeosIo/blob/50a939dc1811b5ac0950cf676a0a7202c8609379/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/FusionObjects/Error.fusion which worked for me.
The Neos.Demo NotFound Error Handling seems just to handle one language dimension as far as I understand. Do I understand it correctly @sebobo ?
Hi Oliver, yes.
Could be improved though.