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 1:12PM
    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 1:12PM
    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 1:12PM
    Thanks for that.
Sign In or Register to comment.