Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Error Class added to 404 page body

edited January 2011 in Bug Reports

In the sample website on the 0.91 branch I was looking to see what the 404 error page looked like so I browsed to http://localhost/fuel/error and the page was blank. I then went into the code and found the content that should have been displayed so I went back to my browser and checked the source with firebug. The html code and text was there in firebug but the text had been given a white colour because a class of error was being added to the body of the page which overwrite all other text colours in the css file.
If I browse to any other page that shows the 404 that I can think of it is fine and the text is freely visible.

I know there is an is_home() helper function would there be any chance of an is_404() function or did I miss that function in the user guide?

Alternatively could we pass a variable through to the header block denote that a page is a 404 and to not add the class with <?php echo fuel_var('body_class', '');?> if its not set?


  • edited 7:17AM
    I just pushed a commit to namespace the error class in the CSS to prevent that issue.

    To answer your question, there is no is_404() function, however, you could set a variable or constant in the error_404.php page that could be used.
  • edited 7:17AM
    After thinking about it a little more, I reset the body_class variable to be blank in the 404 page to prevent the issue for page names that may be the names of other CSS classes.
  • edited 7:17AM
    Thanks for that.
Sign In or Register to comment.