Skip to content

Instantly share code, notes, and snippets.

@mficzel
Last active June 11, 2019 15:09
Show Gist options
  • Save mficzel/b718dea12d230c1357b9590f19e2143e to your computer and use it in GitHub Desktop.
Save mficzel/b718dea12d230c1357b9590f19e2143e to your computer and use it in GitHub Desktop.
Translated 404 Document with Neos 4.3
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