Theming error pages problem

15 views
Skip to first unread message

Paul West

unread,
Mar 3, 2017, 11:32:25 AM3/3/17
to QuickApps CMS
I would like to theme the default error pages I have a custom Theme enabled and active. I have added to my Theme: 

Template/Error/error400.ctp
Template/Layout/error.ctp

but when going to a 404 URL it is still showing the error page from cms/.../error400.ctp

Is there something else I need to do?

Chris

unread,
Mar 3, 2017, 3:38:57 PM3/3/17
to QuickApps CMS
Hi Paul,


However you must be aware of the following:
Exceptions raised due to routing-matching problems will not be theme-aware, because the logic used to determinate whether an user is viewing a backend (URLs with `admin` prefix) or frontend page depends on the current request object (which is build by Cake's Router). So if an URL doesnt matches any valid route is impossible to build a valid request object and then impossible to decide if backend or frontend theme should be used. In this cases the frontend theme will be used by default.

You could also try to use site-wide template feature, you must place your template files at `ROOT/templates/Common`.
I think I forgot to document this feature on the QuickBook, I'll write it ASAP. However you can check code's docblock which gives an idea of this feature: https://github.com/quickapps/cms/blob/2.0/plugins/CMS/src/View/View.php#L239

Hope this helps,
Best regards!

Paul West

unread,
Mar 6, 2017, 4:11:27 AM3/6/17
to QuickApps CMS
Hi Chris,

Yes that commit fixes it, perfect thank you. 

I think using front-end theme by default is the right thing to do here.

Paul 
Reply all
Reply to author
Forward
0 new messages