Keyword

Images included in Latest from author

  • gsharpmarketing
  • gsharpmarketing's Avatar Topic Author
  • Offline
  • New Member
More
13 years 1 month ago #99211 by gsharpmarketing
Images included in Latest from author was created by gsharpmarketing
Hi,

 

I am working on a site that is using K2, virtuemart and K2mart.  I am trying to get the "Latest from author" section on the item.php layout to show the images of the latest posts.  This is a product site and thus the images of the product would be much betten then just the text about the product.

 

I have attached a example of what I want it to look like.

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 #99212 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Images included in Latest from author
Hi Joshua,

 

Just did a quick test and it works for me, but the code below does not check if there is an image or not, it should work fine otherwise it's blank.

 

Please use template override. See Here

 

Just go to your item.php line 430

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

 

Change this to

<a href="<?php echo $item->link ?>"><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; ?>" style="width:30px; height:auto;"/></a>

 

I just took the Large item image and re-sized it to width:30px -< you can change this value as you want.

 

This will display the item images with the default bullet list style. Just change the <li></li> values to <div></div> or <span></span> and style them accordingly.. :D

K2 Rocks \m/

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


Powered by Kunena Forum