Martimiz/silverstripe-googledirections

default link setting (so no link has to be clicked)

Closed this issue · 10 comments

This would be an awesome feature.

I've uploaded a testbranch
https://github.com/Martimiz/silverstripe-googledirections/tree/testdefaultmap

It has a tab in the CMS where you can enter details for a map that displays at startup. Note latlng takes precedence over address! It was a bit of a major adaptation, so would you please test it?

The other options still stand.

@todo: optionally use the data in an existing link to display it at startup!

Tested it and it works like a charm. However the Map Tab was added to all pages, but i got around that by removing it and leaving it in the contactpage where i put the map.

That's because the extension is registered to the Page class by default (see _config/GoogleDirections.yml). You can easily hook it up to any other pagetype...

I got mine hooked up to the contactpage pagetype though....
schermafbeelding 2014-06-07 om 09 39 28

In your mysite/_config/goggledirections.yml, yes, but in the original one it is probably still linked to the page? I never know if I should add the extension by default, or leave it out and let the user take care of it... Maybe just disable it by default...

I used the testdefaultmap branch in one of my projects... Works like a charm.
Thanks a million... great module!

Thanks :)

I'm still working on an improved version, where you can define one or multiple maps from within the CMS, and use shortcodes to automatically create links to display the maps. A checkbox lets you set one map as default, so it will display right away.

You can then either just display one map by default, without any links, as you requested, or easily create multiple links that will dynamically display different maps, without ever doing any coding, just by adding a couple of shortcodes.

The differentce between the current testversion and the new one will be that now you will create your map as a separate object, using a gridfield. So you'd have to re-enter the data.

Of course creating links manually and/or using javascript will still be supported. Links now also support infotext. I hope to have a testversion available this week...

The new version is now merged into Master, the old version is 0.1.

The new Master version is different from the testversion in that you can now add multiple maps to a page and use shortcodes to diplay links.

In your case, to upgrade from the testversion, you'd have to:

  1. enable the module in your _config/googledirections.yml
  2. recreate your map in the 'Maps' tab on your page and set it to display on startup

I hope this will work for you. I will remove the testversion from github shortly.

Hi Martine,
In updated using composer and experienced no problems. In fact, i noticed the translatable requirement is no longer necessary. This is also a good thing, because - in my case - i didn't need it in the project i was working on. By the way.... my client loves it!

Hi Guy,
That's great to hear, thanks :)

About the translatable requirement: that was a stupid mistake and should never have been there in the first place! I only noticed it yesterday. I hope it didn't put too many people off :(