Keyword

Setting one image for all items..

  • Justin Inabinett
  • Justin Inabinett's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #122093 by Justin Inabinett
Setting one image for all items.. was created by Justin Inabinett
What I am doing is using K2 to build a Directory database.

The problem:
I am uploading all my items, but I want to set ALL items to a '1 generic image'. If I can keep this single image from being duplicated in the "/media/k2/items/ Folder would be super nice in maintaining a smaller footprint...

I don't want to necessarily recode it though, because I would like the listings owners, to eventually be able to change the intro image of their item...

Thoughts on how to accomplish this?

Thanks & best regards!
Justin

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 9 months ago - 10 years 9 months ago #122094 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Setting one image for all items..
Hi,

Try this workaround, you will modify only template files, so its not recoding as you wish:

for the item view page, and after applying template overrides of course, edit item.php

find this line:
<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>

Add this code directly before the above line:
<?php 
          if(empty($this->item->image)){
              $this->item->image = 'item/image/path';
              $this->item->imageXLarge = 'item/imageXLarge/path';
              $this->item->image_caption = 'Image caption';
              $this->item->image_credits = 'Image Credits';
              $this->item->imageWidth = 'Image width in numbers without px';
          }
          ?>
make sure to write in the correct values on the right of the equal sign, for example:
item/image/path should be the path to the generic image
item/imageXLarge/path should be the path to the xlarge version of generic image
and so on

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Justin Inabinett
  • Justin Inabinett's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #122095 by Justin Inabinett
Replied by Justin Inabinett on topic Re: Setting one image for all items..
Great idea!!!! I will give it a whirl and let you know how it works!

Thanks a million!

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


Powered by Kunena Forum