Editing error.php default image instead of creating custom 404 page - Joomla! Forum - community, help and support


dear joomla developers , community,

i wondering if please me understand how can force error.php file (404 page) display image of choosing (404.jpg) instead of logo image (logo.png)? easier/better creating custom 404 page, since default 404 page quite good, needs display different image.

let's have own 404 page image located @ /images/404.jpg.

what need error.php code below display image instead of logo?


code: select all

defined( '_jexec' ) or die( 'restricted access' );
$app                      = jfactory::getapplication();
$yjsg_params                = $app->gettemplate(true)->params;
$template                   = $this->template;
$check_style_param             = $yjsg_params->get("yjsg_get_styles");
if(isset($check_style_param)){
   $get_style_value         = explode('|',$yjsg_params->get("yjsg_get_styles"));
   $yjsg_get_styles         = $get_style_value[0];   
   $default_link_color         = $get_style_value[1];
   $site_link_color         = '#'.$default_link_color;   
}else{
    $yjsg_get_styles         = $yjsg_params->get("default_color");
   $default_link_color         = '';
}
$default_font_family             = $yjsg_params->get("default_font_family");
$logo_height                     = $yjsg_params->get("logo_height");
$default_font                    = $yjsg_params->get("default_font");
$logo                      = $this->baseurl.'/templates/'.$template.'/images/'.$yjsg_get_styles.'/logo.png';
if($yjsg_params->get("logo_image")){
  $logo                   = juri::base().$yjsg_params->get("logo_image");
}
?>
<!doctype html>
<html xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" class="yjsg-page-error">
   <head>
      <title><?php echo $this->error->getcode(); ?>-<?php echo $this->title; ?></title>
      <link href="<?php echo juri::base(); ?>templates/<?php echo $template ?>/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
      <link href="<?php echo juri::base(); ?>plugins/system/yjsg/legacy/css/template.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $template ?>/css/<?php echo $yjsg_get_styles; ?>.css" rel="stylesheet" type="text/css" />
   <style type="text/css">a{color:#<?php echo $default_link_color?>;}</style></head>
   <body id="stylef<?php echo $default_font_family ?>" class="yjsgerror-page">
      <div id="centertop">
         <div id="errorpage">
            <div id="header" style="height:<?php echo $logo_height?>;">
               <img src="<?php echo $logo ?>" alt="site_logo" />
            </div>
            <div class="error_title">
               <h1><?php echo $this->error->getcode(); ?></h1>
               <h2><?php echo $this->error->getmessage(); ?></h2>
            </div>
            <p class="errorp">
               <strong><?php echo jtext::_('jerror_layout_not_able_to_visit'); ?></strong>
            </p>
            <ol id="errorol">
               <li><?php echo jtext::_('jerror_layout_an_out_of_date_bookmark_favourite'); ?></li>
               <li><?php echo jtext::_('jerror_layout_search_engine_out_of_date_listing'); ?></li>
               <li><?php echo jtext::_('jerror_layout_mis_typed_address'); ?></li>
               <li><?php echo jtext::_('jerror_layout_you_have_no_access_to_this_page'); ?></li>
               <li><?php echo jtext::_('jerror_layout_requested_resource_was_not_found'); ?></li>
               <li><?php echo jtext::_('jerror_layout_error_has_occurred_while_processing_your_request'); ?></li>
            </ol>
            <p class="errorp">
               <strong><?php echo jtext::_('jerror_layout_please_try_one_of_the_following_pages'); ?></strong>
            </p>
            <ol class="error_link">
               <li>
                  <a 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>
               </li>
               <li>
                  <a href="<?php echo $this->baseurl; ?>/index.php?option=com_search" title="<?php echo jtext::_('jerror_layout_search_page'); ?>">
                     <?php echo jtext::_('jerror_layout_search_page'); ?>
                  </a>
               </li>
            </ol>
            <p class="error_contact">
               <?php echo jtext::_('jerror_layout_please_contact_the_system_administrator'); ?>
            </p>
            <p class="error_msg">
               <?php echo $this->error->getmessage(); ?>
            </p>
            <p>
               <?php if($this->debug) : echo $this->renderbacktrace();   endif; ?>
            </p>
         </div>
      </div>
   </body>
</html>


thanks much!

kind regards,

scott

anyone, please?





Comments

Popular posts from this blog

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support