Mini K2 customization

Hi Memofree

Have you try to follow the steps above? where you could add this line
<?php echo $item->extra_fields[0]->value; ?>

on any minik2 layout file you choose i.e /modules/mod_minik2/tmpl/simple/default.php

And for your specific case - extrafield with id 1 and 2 - the code could look like,
<?php echo $item->extra_fields[0]->value; ?>
<?php echo $item->extra_fields[1]->value; ?>
12 years 3 months ago #7 by erwinschro

Please Log in or Create an account to join the conversation.

hi all

i use this code to show specific extra fields with id 1 to simple template of mini k2 but its not appear in front end, can anybody help?
<?php
/**
 * @version		$Id: default.php 565 2010-09-23 11:48:48Z joomlaworks $
 * @package		K2
 * @author		JoomlaWorks http://www.joomlaworks.gr
 * @copyright	Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */
 
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<div class="minik2" id="minik2<?php echo $modid; ?>">
 
<?php 
$numofitems = count($items);
if($numofitems): 
 
	foreach ($items as $key=>$item):	
 
	?>
 
		<div class="k2item block">
			<?php if ($item->image) { ?>
			<div class="thumbs-wrapper">
<?php if($params->get('itemCategory')): ?>
			<div style="position:relative; z-index:110;"><span class="itemCategory"></div>
				<p style="position:relative; z-index:110;color: #fff;text-align: center;font-size: 14px;" class="moduleItemCategory <?php echo $item->categoryalias; ?>"><?php echo $item->categoryname; ?></p>
			</span>
			<?php endif; ?>
				<div class="thumbs">
					<a href="<?php echo $item->link; ?>">
					<img src="<?php echo $item->image; ?>" alt="<?php echo $item->title; ?>" class="box-img" />
					</a>
                                             <div class="year-div" style="position: absolute;background: #fb0b0b;padding: 10px;transform: rotate(45deg);top: 22px;right: -26px;width: 65px;height: 13px;">
  <p class="year-no" style="color: #fff;font-size: 13px;position: relative;top: 1px;right: 12px;"><?php echo $item->extra_fields[0]->value; ?></p> </div>
				</div>
			</div>
			<?php } ?>
 
			<h2 class="title"><a style="font-size: 12px;font-family: arial;" dir="ltr" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></h2>
 
			<?php if($params->get('itemDateCreated')): ?>
			<!-- Date created -->
			<span class="itemDateCreated">
				<?php echo JHTML::_('date', $item->created , JText::_('DATE_FORMAT_LC3')); ?>
			</span>
			<?php endif; ?>
 
 
 
			<?php if($params->get('itemHits')) { ?>
			<span class="itemDateCreated">
				<?php echo $item->hits; ?> <?php echo JText::_('hits'); ?>
            </span>
			<?php } ?>
 
 
			<?php if($params->get('itemIntroText')): ?>
				<div>
					<p class="minik2-simple-intro">
						<?php echo $item->introtext; ?>
					</p>
				</div>
			<?php endif; ?>
 
            <!-- Item Rating -->
				<?php if($params->get('itemVotesNumber') || $params->get('itemVotesNumber') ) { ?>
				<div class="minik2-simple-rating">
					<?php echo $item->voteVal; ?>
					&nbsp;from&nbsp;<?php echo ($item->numOfVotes==0)? '0': $item->numOfVotes; ?> <?php echo JText::_('votes'); ?>
 
 
				</div>            
				<?php } ?>
 
		</div>
	<?php 
 
	endforeach; 
	?>
	<div class="clr"></div>
<?php endif; ?>
</div>
 
<!-- MiniK2 Joomla 1.7 module - Another Quality Freebie from TemplatePlazza.com -->
8 years 7 months ago #8 by soroush

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum