add a class to the body if the template is 404
is there a way to add an if statement to header.tpl where it adds the class "error_page" to the page if the 404 template is rendered (page not found)? this will help me hide the sidebar, for example, using CSS.
baris last edited by baris
Hi, that's not a bad idea, we already dynamically generate the body class, so I added the response code in there as well. https://github.com/NodeBB/NodeBB/commit/379a15632850e4ed0d7982cea2b5506ce06b7741.
If a page is 404 the body will have
page-status-404if there is an internal error it will have
I tested that and it works great ! thanks again for your help