Pippo3000 Posted May 8, 2013 Share Posted May 8, 2013 (edited) hi, is there a way to create a custom 404 page? I do not like the 404.tpl. is there a way to create a 404 page using CMS and then direct 404.tpl and/or 404.php to that CMS page? Thanks Phil Edited May 8, 2013 by Pippo3000 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 But you can modify 404.tpl page to show your CMS content... you don't have to create separate pages etc. 1 Link to comment Share on other sites More sharing options...
Pippo3000 Posted May 8, 2013 Author Share Posted May 8, 2013 But you can modify 404.tpl page to show your CMS content... you don't have to create separate pages etc. thanks. But I would need to create a CMS page called 404 which I configure to my needs, right? Can you give me a hint what to change in the 404.tpl to redirect to the CMS page then? Thanks Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 You can redirect customers with this simple script: <script language=”JavaScript”> self.location=”PAGE_URL_HERE”; </script> you have to put this code into the 404.tpl file. I'm looking for some other method in prestashop classes, maybe i will find it but i suppose that this isn't what you exactly expect 1 Link to comment Share on other sites More sharing options...
Pippo3000 Posted May 8, 2013 Author Share Posted May 8, 2013 You can redirect customers with this simple script: <script language=”JavaScript”> self.location=”PAGE_URL_HERE”; </script> great. Thanks a lot. So I delete all major content in the 404.tpl and just copy that code above? And no I do not need any classes fix. Too complicated for me ;-) you have to put this code into the 404.tpl file. I'm looking for some other method in prestashop classes, maybe i will find it but i suppose that this isn't what you exactly expect Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 yes you can remove all 404 content Link to comment Share on other sites More sharing options...
Pippo3000 Posted May 10, 2013 Author Share Posted May 10, 2013 does that apply to the 404.php, too? realized that the 404.php is shown and not the 404.tpl Link to comment Share on other sites More sharing options...
vekia Posted May 10, 2013 Share Posted May 10, 2013 ahhh i just realized that you use 1.4.8 ? not 1.5 ? Link to comment Share on other sites More sharing options...
Pippo3000 Posted May 10, 2013 Author Share Posted May 10, 2013 ahhh i just realized that you use 1.4.8 ? not 1.5 ? yes. 1.4.8.2 Link to comment Share on other sites More sharing options...
vekia Posted May 10, 2013 Share Posted May 10, 2013 hello i checked prestashop 1.4.8.2 files and it works exactly the same as it works in 1.5.x 404.php require_once(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('PageNotFoundController')->run(); PageNotFoundController: public function displayContent() { self::$smarty->display(_PS_THEME_DIR_.'404.tpl'); } sot as you can see, this is 404.tpl located in your theme directory... 1 Link to comment Share on other sites More sharing options...
Miniwheels-online_com Posted August 3, 2013 Share Posted August 3, 2013 I wanted to customize my 404 page, but I cannot localize the code for the background image (bg_404.png). I have a different image, but it is too large, so I wanted to edit the width code for this. Where can I find this? tpl nor php file is containing this code. Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 what ps version you use? and you default template? Link to comment Share on other sites More sharing options...
Miniwheels-online_com Posted August 3, 2013 Share Posted August 3, 2013 (edited) Sorry, indeed, I use 1.5.4.1 with the default template. Link to my 404 page: http://www.miniwheels-online.com/en/page-not-found Edited August 3, 2013 by Miniwheels-online_com (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 hello i've noticed that your 404 page is customized: Link to comment Share on other sites More sharing options...
Miniwheels-online_com Posted August 3, 2013 Share Posted August 3, 2013 (edited) Yes, I repaced the original image file with this one, but I cannot make it smaller. With regards, Marcel Edited August 3, 2013 by Miniwheels-online_com (see edit history) Link to comment Share on other sites More sharing options...
Miniwheels-online_com Posted August 3, 2013 Share Posted August 3, 2013 Vekia, I had a brainwave.... yes... Just made the original image smaller... so easy... 1 Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 it is backgrund so in this case just... upload smaller image this is the easies way to achieve what you want 1 Link to comment Share on other sites More sharing options...
Luca Posted March 19, 2018 Share Posted March 19, 2018 On 8/5/2013 at 5:21 PM, vekia said: But you can modify 404.tpl page to show your CMS content... you don't have to create separate pages etc. Hi Vekia, the post is very old, I know, and I'm using PS 1.7.3, but how can I modify 404.tpl page to show CMS content?! TY very much!!! Link to comment Share on other sites More sharing options...
ecn38 Posted May 9, 2019 Share Posted May 9, 2019 On 3/19/2018 at 7:01 PM, Luca said: Hi Vekia, the post is very old, I know, and I'm using PS 1.7.3, but how can I modify 404.tpl page to show CMS content?! TY very much!!! My answer is quite old too but i needed it in an 1.7.5 shop https://www.majory-cubizolles.fr/blog/inserer-une-page-cms-sur-une-page-produit-astuce-prestashop/ https://stackoverflow.com/questions/16449583/show-a-smarty-variable-with-html-content/33900878 Call your content in the tpl file templates/errors/not-found.tpl : {* 16 is the CMS Page used to store the message *} {assign var=cms_content value=CMS::getCMSContent(16)} {if $cms_content.content} <div class="contentCms"> {$cms_content.content nofilter} </div> {else} {* default message *} <h4>{l s='Sorry for the inconvenience.' d='Shop.Theme.Global'}</h4> <p>{l s='Search again what you are looking for' d='Shop.Theme.Global'}</p> {/if} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now