Keyword

Different images for category and item view?

  • Chris French
  • Chris French's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #133089 by Chris French
Different images for category and item view? was created by Chris French
Hi all

Just wondering if it is possible to have a different image for category view and item view. I'm using K2 and k2 store for a jewellery shop and I want to use cropped images for category view so all the product images are the same size, but when you click through to item view I want to show the full un-cropped image.

Is it possible to do this with the default templates or do I need to create a new one?

Thanks in advance for any help.

Cheers

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #133090 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Different images for category and item view?
You have to override your templates for this functionality.
This post will help you: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

You need to add an extrafield as an image and replace K2's default image.
You can render specific extrafields like this:
$this->item->extraFields->EXTRAFIELDALIASHERE->name
$this->item->extraFields->EXTRAFIELDALIASHERE->value 

(Check where $item and $this->item has been used).

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Chris French
  • Chris French's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #133091 by Chris French
Replied by Chris French on topic Re: Different images for category and item view?
Hi Krikor,

Thanks for the tip, I created a new template and changed in category_item.php -> k2ImageBlock

php echo $this->item->image; to

php echo $this->item->extraFields->CatItemthumb->value
php echo $this->item->extraFields->CatItemthumb->name

I'm obviously doing something wrong, is there anything obvious you can see that I need to change?

Cheers for any help you or anyone could provide :cheer:

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

  • Chris French
  • Chris French's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #133092 by Chris French
Replied by Chris French on topic Re: Different images for category and item view?
Hi Krikor

I have solved the issue by using this K2 plugin

styleware.eu/forum/Free-extensions/1269-K2-Patch-to-allow-crop-of-images

That seem to have done the job for me anyway.

Cheers

Chris :lol:

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #133093 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Different images for category and item view?
Nice to hear that Chris.
I 'm happy the plugin worked as intended.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum