Theming 404

Permalink
I am attempting to apply my theme to my 404 page by adding the following to config/site_theme_paths.php

/$v->setThemeByPath('/page_not_found', "franks_pottery");


This should render the 404 using the view.php defined in my theme. The contents of this view.php file are:

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>
<div id="content">
  <?= $innerContent ?>
</div>
<?php  $this->inc('elements/footer.php'); ?>


The issue I am running into is that my header.php file crashes when trying to parse:

<?php
  $a = new Area('Header Nav');
  $a->setBlockLimit(1);
  $a->display($c);
?>


Turning the theme on for the login page works fine however.

The exception raised is:

Fatal error:  Call to a member function getCollectionID() on a non-object in /home/myuser/frankspottery.com/concrete/models/area.php on line 117


Anyone run into this and know a work around?

jereme
 
jereme replied on at Permalink Reply
jereme
Am I really the only person to be in this boat?
synlag replied on at Permalink Reply
synlag
error pages could be displayed as single_pages (system pages). so it'd be possible to set a theme for them. posted already to bugs.
ward7studios replied on at Permalink Reply
Having the same problem myself. Definitely hope to get it resolved.
salesman replied on at Permalink Reply
salesman
i simply created a 404 error page in C5 and excluded it from the main navigation then added to the .htaccess file

ErrorDocument 404 /404error/
wombat replied on at Permalink Reply
Salesman - did you get friendly URL to work with that setup?

The rewrite rules send all pages not found on the filesystem to the front controller: index.php. Apache would therefore never get to a 404 status. I may be missing something though...