Keyword

sig pro and k2 item image

  • hristo
  • hristo's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134234 by hristo
sig pro and k2 item image was created by hristo
Hi. First sory if my english is bad!
Is there any way i can link main item image of K2 item to SIG PRO gallery or somehow the main image to be the first image of the gallery.. and when open in the modal pop up i can next and back all pics in gallery... now they a separate and its very confusing.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #134249 by Krikor Boghossian
Replied by Krikor Boghossian on topic sig pro and k2 item image
Your English is fine.

Unfortunately this is not possible.

If you are experienced with overrides, you can change the "modal" class of K2's image to the one your gallery is using and adding the rel="gallery[xxx]" attribute to that image by using a simple JS script.

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

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

  • hristo
  • hristo's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134253 by hristo
Replied by hristo on topic sig pro and k2 item image
ok i understand what u mean, but how to get "gallery[xxx]" in item.php ? this xxx isn't item ID.. is this xxx in mysql DB saved and to slect it somehow where item id = .. or any other way?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #134317 by Krikor Boghossian
Replied by Krikor Boghossian on topic sig pro and k2 item image
You need to use jQuery's attr() function.
api.jquery.com/attr/

Once the site loads (api.jquery.com/load-event/) you need to store the attr of the gallery and pass it as attribute in the image's link.

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

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

  • hristo
  • hristo's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago - 9 years 5 months ago #134370 by hristo
Replied by hristo on topic sig pro and k2 item image
Hi and tx a alot for the help.
I need only a little push still :) When i add
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  
<script>
$( window ).load(function() {
var title = $( '.sigProLink' ).attr( 'rel' );
$('.k2mainimage a').attr('rel', title );
});
</script>
to my item.php where sigProLink is the class of <a> with thumbs, and .k2mainimage is the class for the div in which is the main k2 image <a>
The script works fine.. when i see the code in frontend, the K2 image link has the same REL as the gallery..
BUT.. the script and especialy the loadind of .../jquery.min.js is conflicting with my Joomla and my template and everything else stops workin properly.. even the modal colorbox for the images which is the reason for all this.. i tried with many other variants local calls, different versions and still the same.
How to execute this script in K2 item.php file without causing conflict?!?

After 3 days headbang with getting this stupid gallery ID.. i desided to find where it is generated and clear it.. and i found it in /www/plugins/content/jw_sigpro/jw_sigpro/tmpl/Classic/default.php /if u use other type ot thumbnails must edit its default.php/
In it i found:
rel="<?php echo $relName; ?>[gallery<?php echo $gal_id; ?>]"
and replaced it with just:
rel="mygallery"
then in my item.php on the link for the main item image i set also rel="mygallery" and voala.. WORKS!
Last edit: 9 years 5 months ago by hristo.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #134400 by Krikor Boghossian
Replied by Krikor Boghossian on topic sig pro and k2 item image
This will work with single galleries. If you insert multiple galleries then the lightbox will display them all.

The jQuery library is not needed since it is already loaded.
This was causing an error. Furthermore since mooTools might be loaded, your script should look like this.

[code]
(function($){
$( window ).load(function() {
var title = $( '.sigProLink' ).attr( 'rel' );
$('.k2mainimage a').attr('rel', title );
});
})(jQuery);
[code]

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

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

  • hristo
  • hristo's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134404 by hristo
Replied by hristo on topic sig pro and k2 item image
yes i know.. but i dont need multi galleries.. there will bi only one i the selected k2 item ... just to know where was my mistake and if i need it in future.. this code.. when i insert it in item.php must it be in <script> </script> ot not?

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


Powered by Kunena Forum