- Posts: 2
COMMUNITY FORUM
Setting one image for all items..
- Justin Inabinett
- Topic Author
- Offline
- New Member
Less
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
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
- Offline
- Platinum Member
- Joomla Developer
10 years 9 months ago - 10 years 9 months ago #122094
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
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:
Add this code directly before the above line: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
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';
}
?>
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
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!
Thanks a million!
Please Log in or Create an account to join the conversation.