Keyword

Related Items as blog/content (instead of as links)

  • Dennis Kmetz
  • Dennis Kmetz's Avatar Topic Author
  • Offline
  • New Member
More
13 years 1 month ago #99215 by Dennis Kmetz
I found this request posted in November 2009... and have not found any reply to it. Now, two years later, I have the same need.

I've been on the hunt for a "catalogue view" type of UI for my website for a while now. K2 has just about everything I'm looking for but there's one thing I wish it (and many other catalogue view components) had. When you select a product, many websites will also recommend similar products or related products. K2 has a related items option by tags but only shows it in link (text) format. What I would like to see is an option to view related items in blog view, with the options equivalent to a K2 menu item. In the end, I'm looking to display the related items in catalogue form (represented by pictures) rather than a list of links which can often be overlooked.

 

Are there any workarounds? Is there anyone working on changing the related items links into actual content?

 

Thanks,

 

Dennis

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
13 years 1 month ago #99216 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Related Items as blog/content (instead of as links)
Hi Dennis,

 

I did this last night for latest item from author with an image and i just tested with related item by tags with a category blog view. I just limit it to 1) Title with Link  2) The Image  3) The Introtext and  4) The Read More link, i didn't include all the other rating and social stuffs. It did work but you need to style it according to your site.

Note : I just did a quick copy and paste the div tags from the category_item.php, so change the class details if you want to style it better.

 

Just do this with template overrides.

 

Go to item.php line Around 440 to 442.

Remove this

<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> 

 

Replace with this

<div class="<?php echo ($key%2) ? "odd" : "even"; ?>"> <h3 class="catItemTitle"> <a href="<?php echo $item->link; ?>">
<?php echo $item->title; ?>
</a>
</h3>
<!-- Item Image -->
<div class="catItemImageBlock">
<span class="catItemImage">
<a href="<?php echo $item->link ?>" title="<?php echo $item->title; ?>">
<img src="<?php echo $item->imageLarge = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg'; ?>" alt="<?php echo $item->title; ?>" title="<?php echo $item->title; ?>" />
</a>
</span>
<div class="clr"></div>
</div>
<div class="catItemIntroText">
<?php echo $item->introtext; ?>
</div>

<div class="clr"></div>
<div class="catItemReadMore">
<a class="k2ReadMore" href="<?php echo $item->link ?>">
<?php echo JText::_('K2_READ_MORE'); ?>
</a>
</div>
</div>
<?php endforeach; ?>


Have a go and let me know if it suites your needs.

K2 Rocks \m/

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

  • pamidipadudravid
  • pamidipadudravid's Avatar
  • Offline
  • Junior Member
More
13 years 1 month ago #99217 by pamidipadudravid
Replied by pamidipadudravid on topic Related Items as blog/content (instead of as links)
Hai kannan naidu.. u rae right...  are u from tamilnadu.. am from andhrapradesh, i completed my MCA in chennai

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
13 years 1 month ago #99218 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Related Items as blog/content (instead of as links)
Hi Ravi,

 

Nope, not from TamilNadu. I'm from Malaysia.

K2 Rocks \m/

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

  • pamidipadudravid
  • pamidipadudravid's Avatar
  • Offline
  • Junior Member
More
13 years 1 month ago #99219 by pamidipadudravid
Replied by pamidipadudravid on topic Related Items as blog/content (instead of as links)
actuavally am talking about ur native place, because ur name look like indian name..

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

  • Dennis Kmetz
  • Dennis Kmetz's Avatar Topic Author
  • Offline
  • New Member
More
13 years 1 month ago #99220 by Dennis Kmetz
Replied by Dennis Kmetz on topic Related Items as blog/content (instead of as links)
Kannan,

 

I added the foreach first line to your code... and WOW... it worked! Thank you very much, and thanks for the prompt reply.

 

(I wonder why this functionality is not available in the core K2 component)

 

Thanks again,

 

Dennis

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
13 years 1 month ago #99221 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Related Items as blog/content (instead of as links)
Hi Dennis,

 

Sorry for missing the foreach line, ctrl + c and ctrl +v error..LOL. Anyway, glad it worked out for you.

 

 

K2 Rocks \m/

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


Powered by Kunena Forum