Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • alex feel Friend
    #1049116

    Hi!

    I want to use the following code from header.php in custom error.php to display the image specified in the template settings:

    <?php
    // get params
    $sitename  = $this->params->get('sitename');
    $slogan    = $this->params->get('slogan', '');
    $logotype  = $this->params->get('logotype', 'text');
    $logoimage = $logotype == 'image' ? $this->params->get('logoimage', T3Path::getUrl('images/logo.png', '', true)) : '';
    $logoimgsm = ($logotype == 'image' && $this->params->get('enable_logoimage_sm', 0)) ? $this->params->get('logoimage_sm', T3Path::getUrl('images/logo-sm.png', '', true)) : false;
    
    if (!$sitename) {
        $sitename = JFactory::getConfig()->get('sitename');
    }
    
    $logosize = 'col-sm-12';
    if ($headright = $this->countModules('head-search or languageswitcherload')) {
        $logosize = 'col-sm-8';
    }
    ?>
    
    <!-- LOGO -->
    <div class="col-xs-12 <?php echo $logosize ?> logo">
        <div class="logo-<?php echo $logotype, ($logoimgsm ? ' logo-control' : '') ?>">
            <a href="<?php echo JUri::base() ?>" title="<?php echo strip_tags($sitename) ?>">
                <?php if($logotype == 'image'): ?>
                    <img class="logo-img" src="<?php echo JUri::base(true) . '/' . $logoimage ?>" alt="<?php echo strip_tags($sitename) ?>" />
                <?php endif ?>
                <?php if($logoimgsm) : ?>
                    <img class="logo-img-sm" src="<?php echo JUri::base(true) . '/' . $logoimgsm ?>" alt="<?php echo strip_tags($sitename) ?>" />
                <?php endif ?>
                <span><?php echo $sitename ?></span>
            </a>
            <small class="site-slogan"><?php echo $slogan ?></small>
        </div>
    </div>
    <!-- //LOGO -->

    Is it possible to do this?

    Saguaros Moderator
    #1049430

    Hi,

    I’m afraid not as the ‘error.php’ is an independent file from the Joomla! CMS.

    Kindly check this documentation for styling for it: https://docs.joomla.org/Custom_error_pages

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 1 reply, has 2 voices, and was last updated by  Saguaros 7 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum