- Posts: 72
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Implementing new responsive lightbox for K2 item Images
Implementing new responsive lightbox for K2 item Images
- quebecguitare
-
Topic Author
- Offline
- Senior Member
dimsemenov.com/plugins/magnific-popup/documentation.html
I already have it implement on my site for a form link.
Is there anyway that I can have an implementation that will not get crushed on the next build update?
Could you help me out?
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Paste the css file in your template's stylesheet.
Paste the js file in your template's js file or include it (docs.joomla.org/JDocument/addScript) at the end of your scripts queue.
Then:
Paste this code in your item.php override. Preferably inside the image's block.
<?php $doc =& JFactory::getDocument(); ?>
<?php
$modal .= "jQuery(document).ready(function(){";
$modal .= " jQuery('.popupmodal').magnificPopup({type:'image'})";
$modal .= "});";
$doc->addScriptDeclaration( $modal );
?>
Then locate and change:
<a class="itemImage modal" rel="{handler: 'image'}"...
to:
<a class="itemImage popupmodal"...
In order to override or locate the item.php file read this post:
www.joomlaworks.net/blog/item/194-k2-inheritance-sub-templating
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
Could you give me a hand?
-http://www.quebecguitare.ca/professeurs/quebec/simon-mart
-Click on the booking link under the Item Title "Disponible pour Réservations"
-Minimize the browser under 400px.
Expected result:
The height of the lightbox should be 80%.
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
The actual height of the contents is proportional to the width of the image. If the height is changed then the image will be distorted.
Unfortunately this is the lightbox's default behaviour and it cannot be changed.
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
Otherwise, at smaller resolution the lightbox for the form is too small.
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Check the ..mfp-iframe-scaler class.
This is what gives the proportions for the iframe.
You can change the padding-top: to eg: 80% for smaller viewports.
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
Have a nice weekend Krikor.
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Always happy to help.
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
I've got this new lightbox installed on the website for K2 item images.
I've added a link at the bottom of the K2 Image with a term substitution using no!number ReReplacer.
The problem is that I want to open the link in the modal as well:
Ref.: www.quebecguitare.ca/administrator/index.php?option=com_rereplacer&view=item&layout=edit&id=19
If "Cliquez pour prévisualiser l'image" (default lightbox text for K2 Image lightbox)
Replace with:
<a class="booknow popup-link" href="www.quebecguitare.ca/admissions"><i class="fa fa-envelope-o"></i>Disponible pour Réservations - cliquez ici pour contacter ce professeur</a>
(<, >, " become > < ")
So this works going to the link "www.quebecguitare.ca/admissions"
However I would like to open this link in the modal, just like a booking link on the K2 Item custom template.
www.quebecguitare.ca/admissions?tmpl=component
Here is the link for the K2 Item modal and this problem:
www.quebecguitare.ca/professeurs/montreal/daniel
Any clues?
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
www.quebecguitare.ca/professeurs/montreal/daniel
Thank you for your time!
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
-Click on this link: www.quebecguitare.ca/professeurs/montreal/daniel
-Click on the K2 Image
-Look at the link at the bottom of the image
-Voilà
Regards.
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- quebecguitare
-
Topic Author
- Offline
- Senior Member
- Posts: 72
Could you give more details?
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
This is what generates this title. You can change this to the item's title or a custom search.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Implementing new responsive lightbox for K2 item Images