Keyword

thumbnail with item display

  • michael neese
  • michael neese's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 2 months ago #86105 by michael neese
thumbnail with item display was created by michael neese
When these items are displayed, there are two links at the bottom of the page...'more in this category'...one forward to the next article or item in the category, and one backward to the previous article or item in the category.
How to display a thumbnails next to the links listings?

Please check this page out for the links at the bottom 'more in this category'...

www.gertrudezachary.net/gertrudes-designs/item/42-award-winning-inlay-cuff.html

Thanks for any information.

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

More
14 years 2 months ago #86106 by Jiliko.net
Replied by Jiliko.net on topic thumbnail with item display
Hi Michael,

If you want a thumbnail of the previous @ next K2 items, you'll have to change some coded in the file 'components/com_k2/templates/default/item.php' at lines 490 to 508.

You have the previousLink and nextLink, you should be able to retrieve the item id and load the related image...

Olivier

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

  • michael neese
  • michael neese's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 2 months ago #86107 by michael neese
Replied by michael neese on topic thumbnail with item display
thank you oliver...I am not knowledgable in code writing...could you point me to a resource regarding the code for "retrieve item id and load the related item"...
Would the item id be the actual thumbnail or would it simply be the item id itself, thus producing the thumbnail in turn?

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

More
14 years 2 months ago #86108 by Jiliko.net
Replied by Jiliko.net on topic thumbnail with item display
Michael,

In attachment, the modifications of the related file concerning prev/next item navigation.

You just have to replace original 490-508 lines with the one in the file.

It will display the XS image of the prev/next item if it exists.

You'll have some css stuff i think... :)

Olivier
Attachments:

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

  • michael neese
  • michael neese's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 2 months ago #86109 by michael neese
Replied by michael neese on topic thumbnail with item display
Thank you, I will apply this now and let you know how it goes....

Olivier Nolbert said:Michael,
In attachment, the modifications of the related file concerning prev/next item navigation.

You just have to replace original 490-508 lines with the one in the file.

It will display the XS image of the prev/next item if it exists.

You'll have some css stuff i think... :)

Olivier

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

  • michael neese
  • michael neese's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 2 months ago #86110 by michael neese
Replied by michael neese on topic thumbnail with item display
It works flawlessly, very very cool...thank you again!

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

More
13 years 10 months ago #86111 by tizfo
Replied by tizfo on topic thumbnail with item display
thanks oliver, it works great!!!




Olivier Nolbert said:Michael,
In attachment, the modifications of the related file concerning prev/next item navigation.

You just have to replace original 490-508 lines with the one in the file.

It will display the XS image of the prev/next item if it exists.

You'll have some css stuff i think... :)

Olivier

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

  • ELEFTHERIOS MANOLIS
  • ELEFTHERIOS MANOLIS's Avatar
  • Offline
  • Junior Member
More
13 years 8 months ago #86112 by ELEFTHERIOS MANOLIS
Replied by ELEFTHERIOS MANOLIS on topic thumbnail with item display
Hi  Olivier

i want to ask you if is possible this little "hack"  doing and for the realated item (by tag)

I want (if is possible) the related item (by tag) to show and photo item, not only tittle

 

i try to "play with code,

 

$relatedItems = $model->getRelatedItems($this->item->id, $this->item->tags, $this->item->ordering);

if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$relatedItems->id).'_S.jpg')) : ?>

<img src="<?php echo JURI::root().'media/k2/items/cache/'.md5("Image".$relatedItems->id).'_S.jpg'; ?>" />

 

 

but!!!!...........

 

please, is it possible to help me

 

thank you very much

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

  • ELEFTHERIOS MANOLIS
  • ELEFTHERIOS MANOLIS's Avatar
  • Offline
  • Junior Member
More
13 years 8 months ago #86113 by ELEFTHERIOS MANOLIS
Replied by ELEFTHERIOS MANOLIS on topic thumbnail with item display
i found a solution

 

change this code (in item.php)

 

 

  <?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?>

 <!-- Related items by tag -->

<div class="itemRelated">

<h3><?php echo JText::_("Related items (by tag)"); ?></h3>

<ul>

<?php foreach($this->relatedItems as $key=>$item): ?>

<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

<a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>

</li>

<?php endforeach; ?>

</ul>

<div class="clr"></div>

</div>

<?php endif; ?>

 

 

WITH THIS CODE

 

  <?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?>

  <!-- Related items by tag -->

<div class="itemRelated">

<h3><?php echo JText::_("Related items (by tag)"); ?></h3>

<ul>

<?php foreach($this->relatedItems as $key=>$item): ?>

            <?php //print_r($item);?>

<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

<a href="<?php echo $item->link ?>"><img src="<?php echo $item->imageXSmall; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" /><span class="itemRelatedTitle"><?php echo $item->title; ?></span></a>

</li>

<?php endforeach; ?>

</ul>

<div class="clr"></div>

</div>

<?php endif; ?>

<div class="clr">

</div>

 

 

And now you have and photo in "related items (by tag)"

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

  • ELEFTHERIOS MANOLIS
  • ELEFTHERIOS MANOLIS's Avatar
  • Offline
  • Junior Member
More
13 years 8 months ago #86114 by ELEFTHERIOS MANOLIS
Replied by ELEFTHERIOS MANOLIS on topic thumbnail with item display
oliver,

 

it is possible to show more than two item, in the "more in this category"???

 

for example

10 item in next

and 10 item for previous

 

it is possible that?

thanks

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


Powered by Kunena Forum