Custom Template Not Applied to Nav on Custom 404 page

Permalink
I posted this question before and didn't get a reply and was wondering if anyone had any ideas. The custom template for the nav isn't being applied to my custom 404 page's Auto Nav bar so my 404 pages current have an unfriendly looking li list being displayed. There isn't an Edit button for the page and I haven't seen a place to apply a default layout for the custom 404 pages so at this point I'm not sure what to do. Any suggestions on how I can fix this? The following is the URL to a 404 page:

http://www.desks-incorporated.com/badpage...

pixo
 
Brainakazariua replied on at Permalink Best Answer Reply
Brainakazariua
I made a custom 404 like this:

I made a new page which I called "error" with the intention to use it as a 404 and 403 page.
and under the concrete/single_pages folder I editted the page_not_found.php and page_forbidden.php files to have the following code:

<?php
header("Location:http://www.websitename.com/pagename");
exit;
?>

remove everything else in it.

this triggers it to open the "error" page on all errors which lead to those pages, ofcourse you need to edit those files again after a core update.

ofcourse you can style that page any way you like.

another solution is posted here, didn't test that one but it might work:http://www.concrete5.org/community/forums/usage/problem-with-custom...
pixo replied on at Permalink Reply
pixo
Thanks. I'll give that a try.
ThemeGuru replied on at Permalink Reply
ThemeGuru
Well you might want to consider hard coding the autonav.

For example:
<?php
$bt = BlockType::getByHandle('autonav'); 
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';                     
$bt->controller->displaySubPages = 'all';
$bt->controller->displaySubPageLevels = 'all'; 
$bt->controller->displaySubPageLevelsNum = '1'; 
$bt->render('templates/header_nav');
 ?>


--
c5bundle
$590+ c5 packages for only $50
http://c5bundle.net
Ta2Ta2 replied on at Permalink Reply
Well, I'm facing the same issue...

The direct link to Page_not_found ishttp://www.pegasusstrategic.com/c5/index.php?cID=13...

Assuming, you browsinghttp://www.pegasusstrategic.com/c5/false...

Page title wiped away as well the autonav template...

any idea? :S
pixo replied on at Permalink Reply
pixo
I ended up doign the suggestion by Brainakazariua by doing the redirect and it worked just fine.
mario replied on at Permalink Reply
mario
After setting the 404 to use a custom theme in config/site_theme_paths.php, I copy a current version of my Header Nav into the Global Scrapbook for a page that has it already.

Then I go to the Dashboard-->Pages and Themes --> Single Pages --> Page Not Found. Click the link to visit it, Edit --> Header Nav and insert the nav from the Scrapbook.
Save and done!

I won't take credit for this solution. I read about it somewhere that I can't remember.

You can also do this with the Login and Register page. Although, you need to temporarily enable Registration in Users and Groups in the Dashboard to access that page. Unfortunately, if you try this with the Forbidden page that just directs you to the 404. Haven't figured out how to add it into that.

It's also handy to use when you've added new Page Types like a special 3 column layout to your site theme like 3_col_layout.php.

I used to have to either create a page using the default types (full, left, etc.) and then switch the design to the new one so the header nav would inherit or paste the nav using the scrapbook into the page itself. With this method, new page layouts have the nav or other elements "baked in" on creation.

I admit this process is not ideal and a bit awkward. It would be more logical that the theme should be applied to these kinds of pages that would be accessed by the general public once you set the site_theme_paths. Actually, it would be even better not to even need to set the theme paths at all. But, "should've, would've could've...".

I suppose since C5 is open source, I should just contribute a way of doing so. However, I'm not that hardcore but maybe eventually...

:) mario