YOOtheme Pro is here! The best WordPress and Joomla theme. Learn more

Avatar thomas.p Support asked

[Tutorial] Add an offline image to YOOtheme Pro

If you are using the YOOtheme Pro template and want to add an offline image to your Joomla offline page, follow these steps.

Before

Image

After

Image

  • go to System->Global Configuration and click the Select button next to Offline Image to select an offline image from your media manager

    Image

  • go to Extensions->Templates->Templates and click on Yootheme Details and Files OR access your site via FTP and navigate to /templates/yootheme/

  • edit the file offline.php

    • at line 29-35 you will see this statement checking for the offline message

      <?php if ($app->getCfg('display_offline_message', 1) == 1 && str_replace(' ', '', $app->getCfg('offline_message')) != '') : ?>
      
          <p><?= $app->getCfg('offline_message') ?></p>
      
      <?php elseif ($app->getCfg('display_offline_message', 1) == 2) : ?>
      
          <p><?= JText::_('JOFFLINE_MESSAGE') ?></p>
      
      <?php endif ?>  
      
    • directly after that add this statement

      <?php if (@getimagesize($app->getCfg('offline_image'))) : ?>
      
          <img src="<?= $app->getCfg('offline_image') ?>" alt="">  
      
      <?php endif ?>
      
  • save & close the file

Please note:

  • This change won't work with .svg files.
  • It can be made update-safe by creating a Child Theme and placing the offline.php into the root folder of the Child Theme. If you have copied the offline.php from YOOtheme Pro and not created your own, you would need to remove the following part for the Child Theme override to work.

    if ($this->params->get('config.child_theme') && file_exists($file = $directory . '_' . $this->params->get('config.child_theme') . '/offline.php')) {    
        return include $file;    
    }
    
  • Tutorial
  • YOOtheme Pro

Edited

11 Answers

1

Avatar thomas.p Support answered

@no64 I’ve updated the thread accordingly, thanks for the reminder.

0

Avatar futuron answered

Maybe I did something wrong but as far as I can tell, the override in the Child Theme does not work (in latest YooTheme Pro version - 1.10.8), which is both strange and a pity since the index.php override does work.
Hope you can fix that.

0

Avatar thomas.p Support answered

Hi futuron,

thanks for pointing that out. I have forwarded this issue to the developers.

Kind regards
Thomas

0

Avatar astrid.van.eerd answered

Why not add this to default template? Would be nice if a Joomla template would include all basic Joomla options.

0

Avatar no64 answered

same here ... override in ChildTheme does not work...

anyway.. I think, it should be possible to style the offline and error page with the PageBuilder.

0

Avatar richard.sparks answered

Same here ... offline.php override in child theme does not work!

0

Avatar thomas.p Support answered

@no64, @richard.sparks In version 1.11.6 there has been a fix for the child theme override of the offline.php.

0

Avatar no64 answered

yes it works now.
But if you just copy the offline.php to the child theme, then you need to comment out this part at line 11:

if ($this->params->get('config.child_theme') && file_exists($file = $directory . '_' . $this->params->get('config.child_theme') . '/offline.php')) {  
    return include $file;  
}

otherwise it won't work.

Know someone who can answer? Share a link to this question via email or twitter.