Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's common to use a multi-line text field to format addresses, and a multi-line address looks much nicer when displayed on its own.
It seems that this module could implement a formatter for multi-line text fields as well. Any text can be one line after you run strip_tags and regex away the newlines :)
Comment | File | Size | Author |
---|---|---|---|
#6 | simple_gmap-textarea-1606756-6.patch | 488 bytes | drupov |
Comments
Comment #1
jhodgdonSee
#1486502: Adding a <br/> in the text output of the address
Comment #2
Allie MickaI understand your interest in limiting scope for this module, but it seems dirty to mandate 2 fields when 1 will do, while imposing formatter-specific requirements on your field data.
What I'm asking for is the ability to create a field that contains information that is meaningful on its own and can be used in a variety of displays. And then I'm asking for this module to add value to that data by allowing administrators to present it as a map. This is much more in keeping with the philosophy behind fields, widgets and formatters than creating a field that is only useful for one formatter.
Would you reject a patch that consolidates a multi-line field lines and nominates this formatter for those field types?
Comment #3
jhodgdonI'd probably accept such a patch. :)
Comment #4
GemVinny CreditAttribution: GemVinny commentedIs there any progress with this? Or does it still need doing?
Multiple pins would be great too :)
Comment #5
jhodgdonI have no immediate plans to add the multi-line feature, so yes, if someone wants it to be done, it still needs to be done.
Regarding multiple pins, I do not think that is possible within the scope of how this module works, and in any case it would be a separate issue (and maybe a duplicate of one already filed and marked "won't fix"? you could try a search).
Comment #6
drupov CreditAttribution: drupov commentedModifying the 'field_types' key in the 'simple_gmap' array in hook_field_formatter_info should be enough?
I made a patch for that. This works for me. Please review.
Ah, and don't forget to clear cache after applying the patch.
Comment #7
jhodgdonNo, that would only *maybe* work if the multi-line field was plain text, but both text_long and text_with_summary can be HTML-formatted. This formatter will not work properly with those fields. It also probably needs to do something sensible with line breaks, when it forms the URLs for maps and iframes.
Comment #8
-Mania- CreditAttribution: -Mania- commentedIn case anyone else is looking for something similar I found a pretty neat way of using your own fields without touching the Google Maps field.
I'm using the Address Field module to gather address details but you could use your own custom fields too. I then use Rules to populate the Simple Google Maps field with all the relevant address information whenever the node is saved. Afterwards you can hide the Google Maps field (CSS or with permissions) as it's not really needed anymore. This way you have full control and don't have to copy-paste address details around.
Thanks for the super awesome module! I get so excited when I find a simple Drupal module that just works.
Comment #9
jhodgdonRelated issue was filed for 7.x so I am changing the title so they are the same.