By hanane on Tuesday, 07 July 2015
Posted in Wanderers
Replies 9
Likes 0
Views 1.1K
Votes 0
Hi
i want to the menu of my site displayed in the error page .How can i do that?
Hello Hanana,

You need to customize the error.php file in /templates/wanderers/error.php to render the menu module on the site
·
Tuesday, 07 July 2015 17:20
·
0 Likes
·
0 Votes
·
0 Comments
·
But i think all the modules are included in the error file!why they are not shown?
·
Tuesday, 07 July 2015 18:00
·
0 Likes
·
0 Votes
·
0 Comments
·
This is by design because we only want to display the error message You can just copy some of the module positions from the template's index.php file over
·
Tuesday, 07 July 2015 18:11
·
0 Likes
·
0 Votes
·
0 Comments
·
It s not working
·
Tuesday, 07 July 2015 19:05
·
0 Likes
·
0 Votes
·
0 Comments
·
I am sorry but unfortunately we do not provide customization support for the wanderers template.
·
Wednesday, 08 July 2015 00:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Backup your site!!!

Create an article with your custom 404 message,, call it something like "my404" if you want

save it and assign it to an unpublished menu call that menu link something like "my404" if you want

Open to edit that menu item you just created and copy the path

it will be somehing like

http://www.your domain .com/index.php?option=com_content&view=article&id=whatever article number my404 has



NOW

go to your error.php file and make a copy of it ((( call it something like error.php_bakup )))

so now you have two files

error.php_backup
error.php


Open error.php and remove everything in it Just below this line: defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );


add the following code:

your code will look like

if (($this->error->code) == ’404′) {
header(‘Location: ‘ . $this->baseurl .’index.php?option=com_content&view=article&id=whatever article number my404 has′);
exit;
}
?>


save the error.php file

upload it to your site

refresh

go to your site and type in some gibberish to see if it works ,, something like: vvvvvv.yoursite.com/lkjsdflkasjdf

you should see your custom 404 page

-------------------------

now, since this is an article link ..like any other.. but being used as your 404 page,, you can assign any module you want.!!

Kewl huh?


If your not happy with this at all,, you have that error.php_backup to restore the original

TMW
TMW
·
Sunday, 06 September 2015 21:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing this TMW Pretty cool technique.
·
Sunday, 06 September 2015 21:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Just remember ,, anyone who uses this technique,, that your 404 error page will appear to anyone visiting your site,, Registered or not,, so keep in mind Access Levels on all assigned modules and such

TMW
·
Sunday, 06 September 2015 22:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing again TMW
·
Sunday, 06 September 2015 22:14
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post