-
AuthorPosts
-
christofferl Friend
christofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 21, 2016 at 9:28 pm #942639I want to make the 404 message according to my wishes and style. What is the best approach for doing this?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 22, 2016 at 10:34 am #942825I have now solved it to 50%. Please see that attached file for better understanding.
Any comments on how to fix it?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 22, 2016 at 2:17 pm #942907You should look at these 2 files
1 – /templates/ja_healthcare/error.php
2 – /templates/ja_healthcare/css/error.cssIn the first file you can find code to manage error codes
second css file manage the styles for it button includedI.E.
<a class="button-home" href="<?php echo $this->baseurl; ?>/index.php" title="<?php echo JText::_('JERROR_LAYOUT_GO_TO_THE_HOME_PAGE'); ?>"><?php echo JText::_('JERROR_LAYOUT_HOME_PAGE'); ?></a>
Regards
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 22, 2016 at 2:19 pm #942912Great. I will try this. However, in order to have it backup safe … what should I be doing in order for the files that I modify now can stay the same regardless of upgrades?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 27, 2016 at 8:29 am #944503Hi, I just watched the template demo that shows that 404 message (http://ja-healthcare.demo.joomlart.com/index.php/en/joomla-pages/j-pages/error-page) … and I would like to have it like this.
My site is only showing the 404 message with a white background …. without the main menu etc whichs is shown in the link above.
Please let me know how to get it like the demo.
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 28, 2016 at 5:03 am #944719404 Page Demo is a menu item article type which has assigned the default template to it
so it behaves exactly like any other menu item on the website, showing main menu and masshead image.
To have it on your website you will need to create a new menu item and a new article and follow steps as described into Joomla documentation article HERE
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 28, 2016 at 8:20 pm #945099Great, however, I try to follow the instructions but the code that you refer to where one should paste in the code is missing.
I am referring to: …/templates/ja_healthcare/error.php file where I am suggested to insert the following code.
if (($this->error->getCode()) == '404') { header('Location: /index.php?option=com_content&view=article&id=75'); exit; }
My questions is where I should put it?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 29, 2016 at 9:32 am #945395Hi
add the code in this way
defined('_JEXEC') or die; if (!isset($this->error)) { $this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); $this->debug = false; } if (($this->error->getCode()) == '404') { header('Location: http://www.yourdomain.com/index.php?option=com_content&view=article&id=XX'); exit; } //get language and direction $doc = JFactory::getDocument(); $this->language = $doc->language; $this->direction = $doc->direction; $theme = JFactory::getApplication()->getTemplate(true)->params->get('theme', ''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head>
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 29, 2016 at 8:17 pm #945560Thanks, I think I got it all fixed now except from one thing … the heading of the article that I created and saved in the uncategorized category is still appearing. I have made the article text in hidden mode … but the word "Articles" in the heading is present. How to I remove it?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 30, 2016 at 6:06 am #945688If you installed quickstart there is already a 404 article – url is index.php?option=com_content&view=article&id=29 simply change the url into error.php file and modify the article error page in main menu
It is better to not add a new article
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 30, 2016 at 2:48 pm #945839OK, I did as you mention … but the heading still appears … and it seems to be related to where you have stored the menu item, meaning that it adds the parent item name as the heading.
Please let me know of any other ideas to overcome this.
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 30, 2016 at 3:02 pm #945841You can build a specific css custom class for the single page
Add to your /templates/ja_healthcare/css/custom.css this css snippet
.noheader .page-title, .page-header h1 { display:none; }
Then edit your menu item with the 404 page and in Page Display tab add the noheader snippet into Page class field
Remember to add at the begnning of the page class an empty space
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
June 30, 2016 at 3:11 pm #945843I am sorry this does not work either as implementing it will hide my left sidebar navigation. Hmm, this is more difficult then expected. Any other ideas?
AuthorPostsThis topic contains 17 replies, has 2 voices, and was last updated by pavit 8 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum