Hello, can you help me to replace the Joomla intro images with one of the econa custom field images I created. I was thinking of doing an override but I am not sure which code to use for the econa custom field image. Thanks, Sima
Latest post by Lefteris Kavadas on Tuesday, 08 August 2017 21:46 EEST
<?php /** * @author Lefteris Kavadas * @copyright Copyright (c) 2016 Lefteris Kavadas / firecoders.com * @license GNU General Public License version 3 or later */ defined('_JEXEC') or die; $image = $field->image; $view = JFactory::getApplication()->input->getCmd('view'); ?> <?php if($view == 'article' && $field->id == 3 || $view != 'article' && $field->id == 4): ?> <?php if ($field->fieldparams->get('image', 1) && $image->src): ?> <div class="econaArticleImageBlock"> <div class="econaImage"> <?php if($image->modal): ?> <a href="https://www.firecoders.com/<?php echo $image->modal; ?>" title="<?php echo JText::_('PLG_FIELDS_ECONA_CLICK_TO_PREVIEW_IMAGE'); ?>" class="econaFieldModal"> <?php endif; ?> <img src="https://www.firecoders.com/<?php echo $image->src; ?>" alt="<?php echo htmlspecialchars($image->alt, ENT_QUOTES, 'UTF-8'); ?>" <?php if($image->srcset): ?> srcset="https://www.firecoders.com/<?php /echo /$image->srcset; /?>" <?php endif; ?> <?php if($image->srcset): ?> sizes="<?php echo $image->sizes; ?>" <?php endif; ?> /> <?php if($image->modal): ?> </a> <?php endif; ?> </div> <?php if ($field->fieldparams->get('caption', 1) && $image->caption): ?> <span class="econaImageCaption"><?php echo $image->caption; ?></span> <?php endif; ?> <?php if ($field->fieldparams->get('credits', 1) && $image->credits): ?> <span class="econaImageCredits"><?php echo $image->credits; ?></span> <?php endif; ?> </div> <?php endif; ?> <?php endif; ?>
<!-- Article --> <article class="clearfix"> <?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?> <div class="article-content"> <!-- Aside --> <?php if ($topInfo || $icons) : ?> <aside class="article-aside clearfix"> <?php if ($topInfo): ?> <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?> <?php endif; ?> <?php if ($icons): ?> <?php echo JLayoutHelper::render('joomla.content.icons', array('item' => $this->item, 'params' => $params)); ?> <?php endif; ?> </aside> <?php endif; ?> <!-- //Aside --> <?php if ($params->get('show_title')) : ?> <?php echo JLayoutHelper::render('joomla.content.item_title', array('item' => $this->item, 'params' => $params, 'title-tag'=>'h2')); ?> <?php endif; ?> <?php echo $this->item->event->afterDisplayTitle; ?> <section class="article-intro clearfix"> <?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->introtext; ?> </section> <!-- footer --> <?php if ($botInfo) : ?> <footer class="article-footer clearfix"> <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?> </footer> <?php endif; ?> <!-- //footer --> <?php if ($params->get('show_readmore') && $this->item->readmore) : if ($params->get('access-view')) : $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); else : $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); $link = new JURI($link1); $link->setVar('return', base64_encode($returnURL)); endif; ?> <section class="readmore"> <a class="" href="https://www.firecoders.com/<?php echo $link; ?>"> <span> <?php if (!$params->get('access-view')) : echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($readmore = $this->item->alternative_readmore) : echo $readmore; if ($params->get('show_readmore_title', 0) != 0) : echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; elseif ($params->get('show_readmore_title', 0) == 0) : echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else : echo JText::_('COM_CONTENT_READ_MORE'); echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; ?> </span> </a> </section> <?php endif; ?> </div> </article> <!-- //Article -->
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
{field 1}
<?php foreach($this->item->jcfields as $field): ?> <?php if($field->type == 'econa'): ?> <?php echo $field->value; ?> <?php endif; ?> <?php endforeach; ?>
Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request. In case you just want to ask a question, you can also use the contact form .