×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Hotspot plugin code in SW tabs for K2

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27018

  • Andrew Soye
  • Andrew Soye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 22
  • Thank you received: 0
Hi Daniel

I am trying to display a single map in my K2 tab using the plugin code. It is partially working but it only displays a small section of the map.



We are using SW tabs from styleware.eu.

Do you know if this can work or is Hotspots not compatible with the tabs. It would be great if it were as otherwise I foresee having to use modules which would be a pain to set up!

Many thanks
Attachments:

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27021

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
How do you add the hotspots there? Do you use a tag or something else?

Regards,
Daniel

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27022

  • Andrew Soye
  • Andrew Soye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 22
  • Thank you received: 0
Hi Daniel

I'm using the plugin code I found on the forum for inserting a single map

I think it was {Hotspot=ID} or similar

I can check precisely in a mo if necessary, just dashing somewhere!

Thanks for your help

Jennie

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27031

  • Andrew Soye
  • Andrew Soye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 22
  • Thank you received: 0
Hi Daniel

This is the syntax I used for the Map plugin test:

{hotspots hotspot=5}

5 is the ID of the hotspot

Thanks
Jennie

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27038

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Are you using the plugin with just k2, or do you also use it in com_content?
The problem is that we render the map when the page is loaded, but since you use tabs -> when the page is loaded the div that holds the map doesn't actually have height + width, since it is hidden. And that is why the map doesn't initialize as it should.
Here is what we did for another user who had the problem:

Okay, try this:
plugins\content\hotspots\hotspots.php line 206 is this:

hotspots.startAll();

right after that line, before the closing " add:
				var triggered;
jQuery('#responsive-tabs').on('click', 'ul li', function() {
var id = jQuery(this).attr('aria-controls');
if(!triggered && jQuery('#'+id+' #hotspots').length) {
google.maps.event.trigger(hotspots.sandbox.mapObj, 'resize');
triggered = true;
}
})

At the end the code should look something like this.
				hotspots.startAll();
				var triggered;
jQuery('#responsive-tabs').on('click', 'ul li', function() {
var id = jQuery(this).attr('aria-controls');
if(!triggered && jQuery('#'+id+' #hotspots').length) {
google.maps.event.trigger(hotspots.sandbox.mapObj, 'resize');
hotspots.sandbox.setCenter();
triggered = true;
}
})
				";


Let me know if this fixes it for you as well.
Regards,
Daniel

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27123

  • Andrew Soye
  • Andrew Soye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 22
  • Thank you received: 0
Hi Daniel

Sorry I've been away on holiday. We only need to use it in the K2 tabs

Thank you for the solution. I just tried adding this code and it worked perfectly!

Can I do an override with this file or will I have to change it if we upgrade?

Thanks again
Jennie :)

Hotspot plugin code in SW tabs for K2 10 years 4 months ago #27128

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
You can't make an override with this file.
Once you update hotspots will override it and you'll have to make the changes again. I'll try to make an option for this in one of the next releases so you won't have to go through that again.

Regards,
Daniel

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28138

  • koray çokol
  • koray çokol's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi Daniel.

I have same problem. I used sw tabs in k2 and hotspot in swtabs (tabs name:haritadaki yeri) But map is not display correct... I add your code in hotspot.php but it is same...

Link: http://sanalosgb.com/1/firma-listesi/item/50-firma-adi



Help please... Thanks...
Attachments:

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28173

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
For you the code looks like this:
var triggered = false;
jQuery('#tabs').on('click', 'ul li', function() {
  if(jQuery(this).find('.icon-map-marker')) {
    google.maps.event.trigger(hotspots.sandbox.mapObj, 'resize');
    hotspots.sandbox.setCenter();
triggered = true;
  }
});

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28174

  • koray çokol
  • koray çokol's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I add code, but issue is continue... If you want, I can give ftp username and password...

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28175

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Where have you added the code I don't see it in the source code of the page?

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28176

  • koray çokol
  • koray çokol's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I added plugins\content\hotspots\hotspots.php line 206.

Now:
hotspots.startAll();
				var triggered = false;
jQuery('#tabs').on('click', 'ul li', function() {
  if(jQuery(this).find('.icon-map-marker')) {
    google.maps.event.trigger(hotspots.sandbox.mapObj, 'resize');
    hotspots.sandbox.setCenter();
triggered = true;
  }
});
";

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28184

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I don't see this code in the source of the page, so you most probably doing something wrong. Let me know your ftp credentials in your ticket and I'll have a look.

Regards,
Daniel

Hotspot plugin code in SW tabs for K2 10 years 1 month ago #28196

  • koray çokol
  • koray çokol's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Ok, I writed FTP credentials in my ticket.

Thanks very much...

Hotspot plugin code in SW tabs for K2 9 years 6 months ago #31090

  • Connect Multimedia & Computers
  • Connect Multimedia & Computers's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0
Hi, I have the same problem with the same plugin SW tabs for K2. I have inserted the code but it does not seem to work on Hotspots v5. Does anybody know what to do ?

Hotspot plugin code in SW tabs for K2 9 years 6 months ago #31115

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
@all - the latest dev. release of Hotspots supports swtabs out of the box (there is an option for this plugin in the settings).
The next stable hotspots release will contain this.

Regards,
Daniel
  • Page:
  • 1
Time to create page: 0.152 seconds