Domain specific 404 pages
Permalink Browser Info Environment
Hi
What do you recommend for Page_not_found 404 pages when working with this addon? Should the page be in the absolute root with the attribute "Allow From All Domains" , or under the domain page tree which means duplication but the themes carry across?
cheers
What do you recommend for Page_not_found 404 pages when working with this addon? Should the page be in the absolute root with the attribute "Allow From All Domains" , or under the domain page tree which means duplication but the themes carry across?
cheers
Type: | Discussion |
---|---|
Status: | Resolved |
Hi,
Here's a good reference on how to set theme specific 404 pages:
http://c5hub.com/learning/custom-theme-specific-single-pages-login-...
If you do that in your /config/site_post.php (there normally isn't such file but you can create it), you can detect also in that file which site is being in question for that request. For further assistance, please see the documenation e.g. on setting site-specific tracking codes.
For the sitemap, I'm afraid there isn't any out-of-the-box solution for that. That requires some custom coding. You can check e.g. reference from our documentation or the auto-nav block. Or you can hire us to do it but honestly it would have to wait some time since we're super busy at the moment.
Antti / Mainio
Here's a good reference on how to set theme specific 404 pages:
http://c5hub.com/learning/custom-theme-specific-single-pages-login-...
If you do that in your /config/site_post.php (there normally isn't such file but you can create it), you can detect also in that file which site is being in question for that request. For further assistance, please see the documenation e.g. on setting site-specific tracking codes.
For the sitemap, I'm afraid there isn't any out-of-the-box solution for that. That requires some custom coding. You can check e.g. reference from our documentation or the auto-nav block. Or you can hire us to do it but honestly it would have to wait some time since we're super busy at the moment.
Antti / Mainio
Hi there
Appreciate the reply. I've actually seen that tute before, for some reason putting the override file in my theme folder doesn't work....only in /single_pages does it override. The issue I have is that I'm using one theme between the two sites - there is a lot of commonality between both so it makes sense not to duplicate the theme. I guess that the trade off is that it could be less flexible, such as in cases like this.
Is there a way to pass values to the controller that triggers the page_not_found page to display, when it gets a 404 response from the server? If it knew from which location (cID) it was triggered, then I could pass that into the page and do a whole bunch of stuff. That would be good.
I feel at this point I am splitting hairs and just making a generic 404 page look good will suffice - it will have a link back to the respective site home pages.
Thanks again
Si
Appreciate the reply. I've actually seen that tute before, for some reason putting the override file in my theme folder doesn't work....only in /single_pages does it override. The issue I have is that I'm using one theme between the two sites - there is a lot of commonality between both so it makes sense not to duplicate the theme. I guess that the trade off is that it could be less flexible, such as in cases like this.
Is there a way to pass values to the controller that triggers the page_not_found page to display, when it gets a 404 response from the server? If it knew from which location (cID) it was triggered, then I could pass that into the page and do a whole bunch of stuff. That would be good.
I feel at this point I am splitting hairs and just making a generic 404 page look good will suffice - it will have a link back to the respective site home pages.
Thanks again
Si
OK, if you have the override in your /single_pages, then yes, I don't think that the theme overrides work in that case. (not 100% sure though)
I don't think you can get any cID in the 404 page because obviously it does not have a cID if the page is not found.
What you can do instead is follow my suggestion above about getting the multiple domains mapping object and then deciding what you can do. And if you want, you can also get the domain's home page object from the mapping object. Please search "domain-specific" from the MD docs.
I don't think you can get any cID in the 404 page because obviously it does not have a cID if the page is not found.
What you can do instead is follow my suggestion above about getting the multiple domains mapping object and then deciding what you can do. And if you want, you can also get the domain's home page object from the mapping object. Please search "domain-specific" from the MD docs.
I have an overridden /page_not_found single page and it is using the theme I want set in the site_theme_paths.php. The override is in /single_pages/page_not_found.php. (I've been reading about setting this override in the theme folder, but I've not had any success with this for some reason)
Aside - the issues I'm having are:
a) showing the page not found view in context of the site it is called from. I'm using hooks in the pages to style the 'different sites' from the same stylesheet, but with styles specific to them (i.e <body class="brad"> or <body class="alf">) but because the route to the page not found template is from the context of root(/) not the sub page I've mapped in the add-on.
b) further to the above, I like to list the site map in this page - I'd like to programmatically assign the page id for the autonav add-on - but I'm not seeing any reliable method to pass this as a parameter to this page when it renders;
I'm sure that I'm overthinking this and it must be simple. How do others do this?
Many thanks
Si