×

Notice

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

TOPIC: Variables Option in non-SEF URLs

Variables Option in non-SEF URLs 9 years 11 months ago #29243

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
I am using NoNumber's Component Anywhere to place your map into various locations on my site without the use of the iframe trick. This works using the non-sef URL for the component as long as I don't have any other variables associated with it. In talking to Peter at NoNumber, the url portion after the # cannot be carried over.

For example:
This works: {component index.php?tmpl=component&Itemid=1467&option=com_hotspots&view=hotspots}
This does not work and I get a blank screen with no map: {component index.php?tmpl=component&Itemid=1467&option=com_hotspots&view=hotspots#38.9684100/-77.3168330/15/cats/1/hotspot/20}

I believe this to be because of the variables after the # to have / instead of a variable assignment such as &cat=1 or &lat=38.9684100.

I searched the forums and documentation looking for the possibility of passing arguments to a structured URL that were not in the SEF format. What I am trying to accomplish is to have the component displayed on the website but zoomed in on a particular Hotspot while retaining the ability to zoom out and explore other hotspots. I want more than what the included module can handle.

I have everything working except for the zoom variable on a particular hotspot.

Can I pass variables into the url using &cat or similar and avoid using the # and /?

BTW, First, this is the ONLY mapping solution that works out of the box and can handle tons of points. I tried the $100 HelloMaps and that was a dismal failure. Terrible. THANK YOU for your work on this. Nothing better.

Variables Option in non-SEF URLs 9 years 11 months ago #29244

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Craig,
Can you explain to me a little more. What are you exactly trying to do and why do you want to include the component in an article (or where exactly)? The component is supposed to be standalone.

If you just want to display some text before the map or below the map - we have module positions for this .

I had a look how componentsanymore functions. Sofar I understand the code Peter is making a request to the url where the component is located. Then he fetches the content, parses it, extracts the stuff in the head (css, js), gets the content and then he ads the css, js to the head of the page where you have you want the component to be.

Hotspots is a dynamic component - which means it generates its result through the use of ajax. When you move around we change the hash in order to get an url that you can share to a friend. Here is what happens when you click the url generated by the component.
You go to the page with Hotspots. Then the javascript in hotspots parses the part after the # and determines the latitude, longitude, category and hotspot that it should look for.

You can't use the hash with componentsanywhere because all this logic is after the page has been loaded. And to Peter's component this stuff isn't available. There are few tricks around that, but they are more hacks...
For example on each of your pages where you include the component you could have a custom javascript init function that would add the hash to the url. To Hotspots it doesn't matter if you are on a hotspot link, or if the component is included somewhere. It will look at the url - if you have a hash, it will try to parse and init the component. If you don't have a hash, then it will fallback to the defaults.

So for example if you are on the page where you have hotspots included -> you could type this to the url #38.9684100/-77.3168330/15 and hit enter and the map should center on that location. When you refresh the page you'll see that the map is also centered on that location.

Another trick, but this one won't work for selecting a specific hotspot is to use the variable overrides in the menu and create a new menu entry for each location. This way you could override the default center and zoom for each menu entry....

That are my ideas sofar. But as I said -> the best thing if you just want to have some text on top and below the component is to use the available module positions.

The component has not been created for this situations and you'll have to bend a lot of things to do what you want.

Cheers,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29245

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
Here is what I am looking for and cannot find it with any other K2 mapping solution. I think most webmasters would love this feature.

Background: I have 6 categories for my install of Hotspots Pro. 60 Sports venues, 140 hotels, 100 restaurants, internal transportation system, etc. I want the ability to show the map in K2 or in an article and reference a sports venue by zooming in on that location. At the same time I want other categories to be visible so if there are other features such as hotels, restaurants, or a bus stop they show up as well. I believe it is better for the user when they go into a K2 item that they are not presented with just the single item and that they can explore the map as a component to see traffic, weather, other locations as well. The user doesn't have to flip between pages in order to discover other K2 items or other layers.

This is the thought of why I want to use Components Anywhere. Take your component and place the full features anywhere and have the ability to set a zoom on a particular area that is being referenced while retaining the exploring option.

Out of ALL of the mapping solutions that I have tried, yours is the closest thing to giving the user that ability. The only thing missing is the option of passing variables before the map is displayed as opposed to after.

If you had the ability to pass along variables in the initial URL for category, hotspot, zoom and the coordinates it would make this way over and above anyone else.

I just think the single item K2 of showing one icon and nothing else with no option of exploring is old school at this point.

Yes I can accomplish this by creating KML files as an overlay, but that is not dynamic and requires the creation of the KML each time new hotels or other features are added. The size of the KML is also an issue.

Hope that explains what I am looking for and hopefully you can understand the benefit that this could provide everyone.

Variables Option in non-SEF URLs 9 years 11 months ago #29246

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
OKAY! Here is an idea that could solve this. I noticed several other people dancing around the same concept in the Tricks section.

When creating the Map menu item:

1. Provide entry to a Map Center position that is not from the global setting. Currently we can only use the global setting for a default coordinate. We can then map center differently for each menu map based on the maps purpose.

2. Allow Custom Zoom to work with the Map Center function. I believe this setting only works with the Map Center Users Position.

These two changes would achieve the same exact thing I am looking for.

HOWEVER, can I do this in the Settings Override now? If I do a custom override of the coordinates will the zoom work with it?

Variables Option in non-SEF URLs 9 years 11 months ago #29247

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
Daniel, I sincerely apologize for not realizing that I could do what I wanted with your AMAZING override feature. I am creating a separate menu item for each sports venue in a hidden menu, then using Components Anywhere to load the georeferenced and zoomed in Hotspots component into articles and even K2 item pages. This provides my visitors the ability to zoom out and continue exploring without having to flip between web pages.

My override in the menu item is a simple:
mapStartPosition=38.6774123,-77.1688072
mapStartZoom=15

I custom make the categories for what I want to be visible around the focus item such as hotels, food, etc.

THIS IS THE BEST, MOST VERSATILE MAPPING SOLUTION FOR JOOMLA! PERIOD.

Variables Option in non-SEF URLs 9 years 11 months ago #29248

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Craig!
Today is your lucky day! You've got selected to be my guinea pig :P

Since a lot of people are requesting this (and it starts to get on my nerves) I decided to write a plugin that you could use to include the map view in any content item (including module).

Here is what you need to do:
1. Install the latest dev. version: compojoom.com/downloads/developer-releas...-hotspots/git98c81aa
2. Go to the plugin manager and enable Content - Hotspots Anywhere.

Here is the description of the plugin:

With this plugin you can load the main hotspots view in an article or a module position. The syntax is as follow {hotspotsanywhere} - this would load the main map. If you want to be zoomed over specific area you can add a hash like this {hotspotsanywhere -1.4584151/44.8614464/1}. You can only have one instance of this plugin on a page!


So you get the idea? You just place {hotspotsanywhere} -> this will load the map with default parameters.
You place:
{hotspotsanywhere -1.4584151/44.8614464/1} - this will load the map at that lat & lng and zoom
You place:
{hotspotsanywhere -1.4584151/44.8614464/1/hotspot/1238} - this will load the map on that location and will try to open hotspot with id 1238

My solution should be way faster than Peter's as it no longer makes a request to the hotspots url. It uses the joomla framework to render the map view.

Let me know if it works for you.
Here is a screenshot www.diigo.com/item/image/48vz2/k4be you can see that I have included the component into an article.

Important: you can have only one hotspots on a page! If you have that code in a module and in the article on the same page just one of them will work.
Also please notice that the hash parameter doesn't have the # sign in it when you provide it in the plugin.

Let me know if this works for you!

Cheers,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29249

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ah and you should have at least one menu item pointing to the map. This is necessary as otherwise hotspots is going to miss some variables and won't be able to display the map.

Variables Option in non-SEF URLs 9 years 11 months ago #29251

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
I will give this a try Daniel! Whatever I can do to help you and your work. You helped me and I give back what I can.

Installing now.

Variables Option in non-SEF URLs 9 years 11 months ago #29252

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
WOW!!!!!!!!!!!!!! This is AMAZING! I simply took everything after the # and placed it after your hotspotanywhere and it just works! I can filter to several categories, specific hotspot, lat long.

I just want to kiss you right now. This is huge and I can guarantee you that your sales will increase. I will promote this myself.

Variables Option in non-SEF URLs 9 years 11 months ago #29253

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
While testing hotspotanywhere I could not get it to show up in a K2 article. I used a custom html module position 10 and inserted the code. See the screenshot. For some reason it is not picking up the trigger.

{hotspotsanywhere 38.6756170/-77.1670380/15}
Attachments:

Variables Option in non-SEF URLs 9 years 11 months ago #29254

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Custom HTML module right? Are you sure that you've turned "Prepare content" on in the options of the module?

Regards,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29258

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
When I turn on Prepare content I get a blank screen. Yes, custom HTML module.

Variables Option in non-SEF URLs 9 years 11 months ago #29259

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Blank screen indicates a fatal PHP error. Go to you jOomla's global config and set error reporting to maximum. Then visit again the page with the module and let me know what the error is.

Regards,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29262

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
Warning: require(/homepages/1/d297765305/htdocs/site9/components/com_hotspots/hmvc.php): failed to open stream: No such file or directory in /homepages/1/d297765305/htdocs/site9/plugins/content/hotspotsanywhere/hotspotsanywhere.php on line 75

Fatal error: require(): Failed opening required '/homepages/1/d297765305/htdocs/site9/components/com_hotspots/hmvc.php' (include_path='.:/usr/lib/php5.4') in /homepages/1/d297765305/htdocs/site9/plugins/content/hotspotsanywhere/hotspotsanywhere.php on line 75

Variables Option in non-SEF URLs 9 years 11 months ago #29263

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Häää? Did you uninstall the component? Or did you install a new version? It's missing the hmvc.php file that is part of the dev. version I gave you.

Regards,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29265

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
I will get that on there and report back.

Variables Option in non-SEF URLs 9 years 11 months ago #29269

  • Craig Luecke
  • Craig Luecke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 30
  • Thank you received: 0
Fatal error: Call to a member function setDescription() on a non-object in /homepages/1/d297765305/htdocs/site9/components/com_hotspots/views/hotspots/view.html.php on line 79

Variables Option in non-SEF URLs 9 years 11 months ago #29277

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
That whole thing makes me wonder. What did you do in the first place? First you wanted to come over to Germany and kiss me, now you get all the errors :)

This error shows that you most probably don't have a menu link to the hotspots map, is this possible?

Regards,
Daniel

Variables Option in non-SEF URLs 9 years 11 months ago #29301

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Craig,
How is it looking with this? I want to release version 4.3 with this and would like to be sure that it works :)

Cheers,
Daniel
  • Page:
  • 1
Time to create page: 0.149 seconds