Keyword

adding another image plugin

More
13 years 4 months ago #96734 by BBC
Replied by BBC on topic adding another image plugin
I just tested. And it works OK. You can have 3 (out of 5 max) new images, at different positions in Item template. (one is reserved for Category thumb, and one for image at the top)

 

<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?> <!-- Item Image --> <div class="itemImageBlock"> <span class="itemImage"> <a class="modal" rel="{handler: 'image'}" href="<?php echo $this->item->imageMedium; ?>" title="<?php echo JText::_('Click to preview image'); ?>"> <img src="<?php echo $this->item->imageMedium; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" /> </a> </span> <?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?> <!-- Image caption --> <span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span> <?php endif; ?> <?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?> <!-- Image credits --> <span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?>

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

More
13 years 4 months ago #96735 by BBC
Replied by BBC on topic adding another image plugin
This solution opens many, many posibilities. :)

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

More
13 years 4 months ago #96736 by BBC
Replied by BBC on topic adding another image plugin
Note bolded text in post above.

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

More
13 years 4 months ago #96737 by BBC
Replied by BBC on topic adding another image plugin
Small correction. You can use 2 additional places for images. Third image is used for Modal box popup.

 

But, if you need more then 3 big pictures per Item together, use Gallery. Otherways it is stupid.

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

  • dezignas
  • dezignas's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96738 by dezignas
Replied by dezignas on topic adding another image plugin
He he, really many thanks to you  BBC :) Havent tested it yet, but I'm sure it will work like charm :)

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

  • dezignas
  • dezignas's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96739 by dezignas
Replied by dezignas on topic adding another image plugin
Hey it worked, though i used  Xsmall override, the problem with it is you must have something to override the main image otherwise you will get main image squashed...

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

More
13 years 4 months ago #96740 by BBC
Replied by BBC on topic adding another image plugin
Try to explain it some other way. You need to be more clear.

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

More
13 years 4 months ago #96741 by BBC
Replied by BBC on topic adding another image plugin
This tweak needs also option in Item settings to show/hide all 5 images in Items.

I will check if it is easy to tweak already existing option for top image. Copy code and change a little bit.

If you put new image positions it would be shown allways. Even if it is the same picture as picture at the top.

 

It would be perfect with some PHP code to put new positions after so many characters/words, etc....But, it is not easy.

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

More
13 years 4 months ago #96742 by BBC
Replied by BBC on topic adding another image plugin
It´s easy.

Open

administrator/components/com_k2/models/item.xml

and under your code for Item view options
> Image settings

put this:

 

<param name="itemImageLarge" type="list" default="" label="K2_IMAGE Large" description=""> <option value="">K2_INHERIT_FROM_CATEGORY</option> <option value="0">K2_HIDE</option> <option value="1">K2_SHOW</option> </param>

 

You need to rename in first code:

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

 

to:

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

 

This is a example for Large Image under text. Repeat that process for all images you want in Item.

And rename them according that.

 

In Item Manager you get new options for Show/hide new images.

 

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

  • dezignas
  • dezignas's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 4 months ago #96743 by dezignas
Replied by dezignas on topic adding another image plugin
Hey cool it works just param code must be like this 

 

<param name="itemImageXSmall" type="list" default="" label="K2_IMAGE XSmall" description="">

 <option value="">Inherit from category</option>   

  <option value="0">Hide</option>     

<option value="1">Show</option>

</param>

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


Powered by Kunena Forum