Last active
June 11, 2019 15:09
-
-
Save mficzel/b718dea12d230c1357b9590f19e2143e to your computer and use it in GitHub Desktop.
Translated 404 Document with Neos 4.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error { | |
// find the 404 document | |
@context.notfoundDocument = ${q(site).children('notfound').get(0)} | |
// use german not found page if the request uri starts with /de | |
@[email protected] = ${q(value).context({'dimensions': {'language': ['de']}, 'targetDimensions': {'language': 'de'}}).get(0)} | |
@[email protected][email protected] = ${String.startsWith(request.httpRequest.serverParams.REQUEST_URI, '/de')} | |
// render the 404 document via /root path | |
4xx { | |
@position = 'start' | |
condition = ${statusCode >= 400 && statusCode < 500 && notfoundDocument} | |
renderer = Neos.Fusion:Renderer { | |
@context.node = ${notfoundDocument} | |
@context.documentNode = ${notfoundDocument} | |
renderPath = '/root' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment