test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • suzanna Friend
    #204382

    I would like to change the listing look of the search items where additional info is loaded next to the photo, not under it. is that possible?

    Luna Garden Moderator
    #561840

    Hi Suzana,

    Yes, it’s possible, with condition image is not included in content, but adding in field image.
    Bellow is my suggestion:
    Go to file componentscom_k2templatesyour_k2templatecategory_item.php
    copy these line

    <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>
    <!-- Item extra fields -->
    <div class="catItemExtraFields">
    <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
    <ul>
    <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
    <?php if($extraField->value != ''): ?>
    <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
    <?php if($extraField->type == 'header'): ?>
    <h4 class="catItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
    <?php else: ?>
    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
    <?php endif; ?>
    </li>
    <?php endif; ?>
    <?php endforeach; ?>
    </ul>
    <div class="clr"></div>
    </div>
    <?php endif; ?>

    under:

    <?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
    <!-- Item Image -->
    <div class="catItemImageBlock">
    <span class="catItemImage">
    <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
    <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
    </a>
    </span>
    <div class="clr"></div>
    </div>
    <?php endif; ?>

    then add some css to make the Extra field loaded next to the photo.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Luna Garden 9 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum