Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • christofferl Friend
    #942639

    I want to make the 404 message according to my wishes and style. What is the best approach for doing this?

    pavit Moderator
    #942641

    Hi

    You can take a look at the joomla documentation HERE

    Or search on this forum using – custom 404 page – as search keyword you will find a lot of topics.

    Regards

    christofferl Friend
    #942825

    I have now solved it to 50%. Please see that attached file for better understanding.

    Any comments on how to fix it?


    1. ja_4041
    pavit Moderator
    #942907

    You should look at these 2 files

    1 – /templates/ja_healthcare/error.php
    2 – /templates/ja_healthcare/css/error.css

    In the first file you can find code to manage error codes
    second css file manage the styles for it button included

    I.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 Friend
    #942912

    Great. 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 Moderator
    #942947

    Hi

    Try to take a look at the specific documentation HERE

    Regards

    christofferl Friend
    #944503

    Hi, 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 Moderator
    #944719

    404 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 Friend
    #945099

    Great, 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 Moderator
    #945395

    Hi

    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&amp;view=article&amp;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 Friend
    #945560

    Thanks, 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 Moderator
    #945688

    If 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 Friend
    #945839

    OK, 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 Moderator
    #945841

    You 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


    1. Screenshot_5-5
    christofferl Friend
    #945843

    I 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?

Viewing 15 posts - 1 through 15 (of 18 total)

This 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