[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/content/ -> intro_image.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Layout\LayoutHelper;
  14  use Joomla\CMS\Router\Route;
  15  use Joomla\Component\Content\Site\Helper\RouteHelper;
  16  
  17  $params  = $displayData->params;
  18  $images  = json_decode($displayData->images);
  19  
  20  if (empty($images->image_intro)) {
  21      return;
  22  }
  23  
  24  $imgclass   = empty($images->float_intro) ? $params->get('float_intro') : $images->float_intro;
  25  $layoutAttr = [
  26      'src' => $images->image_intro,
  27      'alt' => empty($images->image_intro_alt) && empty($images->image_intro_alt_empty) ? false : $images->image_intro_alt,
  28  ];
  29  ?>
  30  <figure class="<?php echo $this->escape($imgclass); ?> item-image">
  31      <?php if ($params->get('link_intro_image') && ($params->get('access-view') || $params->get('show_noauth', '0') == '1')) : ?>
  32          <a href="<?php echo Route::_(RouteHelper::getArticleRoute($displayData->slug, $displayData->catid, $displayData->language)); ?>" itemprop="url" title="<?php echo $this->escape($displayData->title); ?>">
  33              <?php echo LayoutHelper::render('joomla.html.image', array_merge($layoutAttr, ['itemprop' => 'thumbnailUrl'])); ?>
  34          </a>
  35      <?php else : ?>
  36          <?php echo LayoutHelper::render('joomla.html.image', array_merge($layoutAttr, ['itemprop' => 'thumbnail'])); ?>
  37      <?php endif; ?>
  38      <?php if (isset($images->image_intro_caption) && $images->image_intro_caption !== '') : ?>
  39          <figcaption class="caption"><?php echo $this->escape($images->image_intro_caption); ?></figcaption>
  40      <?php endif; ?>
  41  </figure>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer