Dear sir,
I want to show item Extra Fields and item create date, under Latest Item From Author in the item view (template override). I tried the below code for loading a specific field but not working.
<?php if($item->extraFields->size->value != ''): ?>
<span><?php echo $item->extraFields->size->value; ?></span>
<?php endif; ?>
And this code for loading item created date.
<span><?php echo JHTML::_('date', $item->created, 'd F Y'); ?></span>
Here are the complete codes:
<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
<!-- Latest entry from author -->
<div class="downloadMore">
<div class="downloadMoreHeader">
<h2><span>Recently Added</span></h2>
</div>
<div class="downloadMoreInner">
<div class="slick-slider">
<?php foreach($this->authorLatestItems as $key=>$item): ?>
<div class="slide <?php echo ($key%2) ? "odd" : "even"; ?>">
<a href="<?php echo $item->link ?>">
<figure><img src="<?php echo $item->imageXSmall; ?>" class="dImg" /></figure>
<span class="title"><?php echo $item->title; ?></span>
</a>
<div class="_11SJc">
<div class="_2SwlV">
<span><?php echo $item->hits; ?> views</span></div>
<div class="_2ANKF">
<span class="_BOPS"><?php echo JHTML::_('date', $item->created, 'd F Y'); ?></span></div>
</div>
<?php if($item->extraFields->size->value != ''): ?>
<span><?php echo $item->extraFields->size->value; ?></span>
<?php endif; ?>
<div class="downloadMoreFooterOuter">
<span class="downloadMoreFooter"><i class="amazonAffiliate"></i></span>
<span class="downloadMoreFooter"><button type="button" class="btn">More</button></span>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>