404 page theme

Permalink
Hi, I have a problem to customize my 404 page at the webbsite i'm working on. I've been able to customize it before by adding this to the site_theme_paths.php.:

$v = View::getInstance();
$v->setThemeByPath('/page_not_found', "greek_yogurt");

The problem is that the new site has a own customized theme and it is stored in another folder which means just changing the theme in site_theme_paths.php won't work.
Does any one know how to handle this?

The customized theme is stored in project\themes
and the comcrete5 themes are in project\concrete\themes

 
mesuva replied on at Permalink Best Answer Reply
mesuva
I believe you can just call the function but without specifying a theme, i.e.

$v->setThemeByPath('/page_not_found');

This then uses the currently active theme, utilising the theme's view.php file as the layout/wrapper.

However, I also think you can just put in the name of your custom theme in that function - concrete5 isn't looking for a path here, it's just looking for a theme 'handle', so it should still find your theme in the top level themes directory. It just has to be installed.
nickeborgare replied on at Permalink Reply
Great, that worked, Thanks! The only problem that the 404 page misses the drop down menu. Du you have any idea how solve this? Is it possible to adding content and style it with the css?
mesuva replied on at Permalink Reply
mesuva
You can actually edit the 404 page just like any other page in your site, so you should be able to just visit it while you are logged in and edit it to add whatever blocks are missing.

The 404 is just another 'single page' in concrete5. The cool thing is you can add editable areas to single pages (when you override them), or via your theme's view.php file. I often add extra areas to the login and register pages to be able to easily add/edit instructions, for example.

It sort of sounds like you've set up your navigation as a default page block, as opposed to a global area. Although it's not technically wrong, I prefer when I'm building a custom theme to set up such areas as Global, avoiding these kind of scenarios. If you ALWAYS want to show your navigation, set it up as a Global Area so you only have to add it once.

(just a note, if you change an editable Area to a GlobalArea, DONT use the same handle, pick something new).
nickeborgare replied on at Permalink Reply
Perfect mate!
Cheers!