- Posts: 214
COMMUNITY FORUM
k2 item image lightbox in natural size
- George Nasis
-
Topic Author
- Offline
- Elite Member
Less
More
9 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
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 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
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
Please Log in or Create an account to join the conversation.
- George Nasis
-
Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
9 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
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 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.
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.
Please Log in or Create an account to join the conversation.
- George Nasis
-
Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
9 years 9 months ago - 9 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
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: 9 years 9 months ago by George Nasis.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 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.
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.
Please Log in or Create an account to join the conversation.
- George Nasis
-
Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
9 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 ""
and then i assign to the href the last value
thank you very much krikor for the useful inf! :D :D
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 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 :)
Please Log in or Create an account to join the conversation.