It would be great to have the option to display the input address as the link to the map.

Comments

jhodgdon’s picture

Interesting idea. Consider it requested. :)

jameswoods’s picture

Status: Active » Needs review
StatusFileSize
new4.72 KB

I had this need too. I have included a patch against the rc1 version.

My patch adds a new setting called "Render the textual address as a link". I tried to follow the coding style as close as possible. I wanted to be as non-invasive as possible, but some small things had to be changed.

I'm pretty new to patching, so I hope this is ok.

I also changed the status of the issue because I submitted the patch.

jhodgdon’s picture

Thanks! I'm on vacation at the moment, but I'll take a look at your patch when I return.

jhodgdon’s picture

Status: Needs review » Needs work

I took at look at this patch today, thanks! I think it needs a bit of work before I would add it to the module:

- Coding standards - if you need to include ' within a quote, use "". Comments should wrap at 80 characters. Indentation is off in at least one place.

- I'd prefer to see the logic that substitutes the address as the link text be done in the pre-processing rather than the tpl.php file. I don't think the tpl file should need to change.

d_mo’s picture

i modified line 115 of .module:

'link_text' => $link_text != "<address>" ? $item['value'] : $link,

so if you type <address> the field itself become the link. i already saw this kind of approach in other drupal modules. hope it helps

jhodgdon’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev

I would prefer to see it as '[address]' rather than '
', but this would be an OK approach. The reason is that some text in Drupal is run through functions that remove HTML tags, and <> looks like an HTML tag.

There is another example in the current release (1.0) of this type of approach: for the language code, you can type in 'page' (without the quotes and without a [] on it), which means "use the page's current language".

jhodgdon’s picture

Status: Needs work » Fixed

This is taken care of (in the new DEV version of the module, which you should be able to download within 12 hours). What I did was make it so that if you entered 'use_address' (without the quotes) in the Link Text field on your display settings, it will use the value of the field rather than requiring static text. I also updated the help on that setting to explain this.

Québec’s picture

Hi,

first, thanks for this cool module: simple, straightforward and effective!

Is the dev version safe enough so to get the «adress as link»? Just to be shure.

Thanks for your time.

jhodgdon’s picture

Yes, the dev version is fine to use. As compared to 7.x-1.0, it just has a fix for this issue and one other at the moment
#1866434: Allow width to be specified in % for responsive designs

Québec’s picture

Thanks!

Works great! And having the adress as link is just perfect!

gliss’s picture

is it possible, with this new feature, to make the map itself (not the textual address) be a link to google maps? or make this link customizable (editable), so for example, it could be combined with colorbox and open googlemaps in a modal?

jhodgdon’s picture

Making the map itself a link would not be possible, since it's a "live" map, and clicking on the map activates Google Maps features, so the whole map couldn't also be a link, right?. But I will add the idea to this other issue, since with a "static" map it would be possible:
#1790250: Add ability to have a static map

Regarding making the link more customizable, you should be able to do that by overriding the theme template simple-gmap-output.tpl.php in your theme.

Also... In the future, if you have a feature request or a question, please start a new issue rather than adding to an issue that has already been marked "fixed" or "closed". That goes for all projects on drupal.org. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.