Keyword

Default Item Image dependent on category

  • Alex Mue
  • Alex Mue's Avatar Topic Author
  • Offline
  • New Member
More
7 years 7 months ago #158140 by Alex Mue
Hello everyone,

i wonder if there is a possibility to set a default image for an item for each category?
So that if there is no image uploaded for an item - the default image serves as a fallback.

Does anybody know where i have to edit the code? Which script inserts the Item into the Database?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #158149 by Krikor Boghossian
Replied by Krikor Boghossian on topic Default Item Image dependent on category
Hello,

You can do this on your overrides - getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

A starting point can be found here:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L90-L99

Based on the item's category name, $this->item->category->name you can populate the image's link.

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