CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   General web building (http://www.codingforums.com/forumdisplay.php?f=10)
-   -   Joomla K2 Extension Problem. (http://www.codingforums.com/showthread.php?t=238228)

jmc 09-16-2011 05:14 AM

Joomla K2 Extension Problem.
 
So i have this code changed in ../html/com_k2/template/default/item.php:
Code:

<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
      <!-- Item extra fields -->
      <div class="itemExtraFields">
          <h3><?php echo JText::_('Additional Info:'); ?></h3>
          <ul>
            <?php foreach ($this->item->extra_fields as $key=>$extraField):?>
<?php $user =& JFactory::getUser(); ?>
<strong><?php if($extraField->name == "Price" && $user->get('Guest') ==1): ?></strong>

    <?php else: ?> 
                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
                    <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
                    <span class="itemExtraFieldsValue"><?php echo ($extraField->type=='date')?JHTML::_('date', $extraField->value, JText::_('K2_DATE_FORMAT_LC')):$extraField->value; ?></span>
                </li>
                <?php endif; ?>
            <?php endforeach; ?>
            </ul>
        <div class="clr"></div>
      </div>
      <?php endif; ?>

What I'm trying to achieve is to hide the extrafield on Guest Viewer on the front-page, and that extrafield will only be visible to certain User groups. I already tried changing these three times:
  • <strong><?php if($extraField->name == "Price" && $user->get('Guest') ==1): ?></strong>
  • <strong><?php if($extraField->name == "itemExtraFields" && $user->get('Guest') ==1): ?></strong>
  • <strong><?php if($extraField->name == "itemExtraFieldsValue" && $user->get('Guest') ==1): ?></strong>

(I named my custom field as Price)

So i don't know if I'm missing something on the code or i got the itemFields name wrong. Any help would be appreciated a ton. I already asked in the k2 forum and joomla forum but no one wanted to help i guess.

jmc 09-16-2011 10:22 AM

any idea? anyone?


All times are GMT +1. The time now is 11:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.