Keyword

k2 item image lightbox in natural size

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
8 years 9 months ago #145465 by George Nasis
k2 item image lightbox in natural size was created by George Nasis
hallo there,

is there any way to display the modal image of the item in its natural size instead of setting the width in the category section??

thank you very much

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145478 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 item image lightbox in natural size
The XL image is displayed in the module.
If you want to change the modal entirely you can look at this post: www.joomlaworks.net/forum/k2-en/42008-implementing-new-responsive-lightbox-for-k2-item-images

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

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
8 years 9 months ago #145481 by George Nasis
Replied by George Nasis on topic k2 item image lightbox in natural size
hallo kriko!

thank you for your response and the helpful post.

i read it carefully but as i can understand it will not change the image to the natural size. the href to the imageXLarge will remain i think

thank you

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145539 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 item image lightbox in natural size
Yes, it will change the size but you can control the lightbox itself.
The original image is strored in the /src instead of the /cache folder so it is possible with some PHP ( str_replace php.net/str_replace ) to get the URL of the original image. Just make sure to drop the _XL from the filename as well.

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

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
8 years 9 months ago - 8 years 9 months ago #145558 by George Nasis
Replied by George Nasis on topic k2 item image lightbox in natural size
hi krikor,

i successfully implent this modal function. i also replace the href="<?php echo $this->item->imageXLarge; to href="<?php echo $this->item->image;

where exactly should i add the str_replace to change the source folder?

thank you very much krikor
Last edit: 8 years 9 months ago by George Nasis.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145568 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 item image lightbox in natural size
The item->image will produce the image size which is defined in K2's settings.

You need to use str_replace on this variable to replace the _L or _XL of the filename and swap /cache with /src.

The link I sent you covers this procedure.

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

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
8 years 9 months ago #145578 by George Nasis
Replied by George Nasis on topic k2 item image lightbox in natural size
hallo krikor!

i had confused but i figured it out!

i should first swap from cache to scr, then assing it to another variable to replace the "XL" to ""
<?php $modalimage = $this->item->imageXLarge; ?>
          <?php $modalimage = str_replace("cache","src",$this->item->imageXLarge); ?>
          <?php $modalimagetrue= $modalimage; ?>
          <?php $modalimagetrue = str_replace("_XL","",$modalimage); ?>

and then i assign to the href the last value

thank you very much krikor for the useful inf! :D :D

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145606 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 item image lightbox in natural size
You 're welcome mate :)

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