Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I know how to add extra fields to the store side panel but would like to add a phone number and hours to the marker popup only. How do I do this? When I add fields to the geoJSONfeed description via global: custom_text, which is: [gsl_addressfield]
[field_store_locator_phone]
[field_store_locator_office_hours], it shows up in the store side panel but not the marker popup. The marker popup, repeats the store address twice. I would like the address on top and the phone/hours below in the "features" area of the marker.
Comment | File | Size | Author |
---|---|---|---|
#12 | store-locator.jpg | 125.7 KB | promarka |
#10 | StoreLocator-phone-website.jpg | 139.15 KB | endless_wander |
Comments
Comment #1
michfuer CreditAttribution: michfuer commentedCurrently adding fields to the marker popup is not supported through the admin UI. They're added through the 'props' parameter of the storeLocator.Store objects which are created in the google_store_locator.js file. This issue is coming up enough though that I think we should seriously consider adding it as a feature. You can read more about the storeLocator.Store class here
Comment #2
adster13 CreditAttribution: adster13 commentedWould love for this to be implemented so I can add store opening hours only to the map popup.
Comment #3
ranbirp CreditAttribution: ranbirp commentedHi
@michfuer
Sorry, I was looking through the file and couldn't see where to add this data, could you advise please?
Thanks
Comment #4
prezaeis CreditAttribution: prezaeis commentedditto
Comment #5
prezaeis CreditAttribution: prezaeis commentedany news on this?
Comment #6
michfuer CreditAttribution: michfuer commentedCheckout my comment to adster13's question on the Drupal Commerce Blog.
Currently this will take a good bit of customization. I have on my 'To Do list for future versions' to just add the most widely used properties (e.g. phone number, website) as fields on the 'Store Location' content type, and then they would still be added both to the infoWindow and the panel element.
Dictating which element (infoWindow or panel) the property gets added to is going to be difficult to add as something you can configure via the admin UI.
Comment #7
RKS CreditAttribution: RKS commented@michfuer
I think you would be best served adding generic fields and allow the user to label them when creating the content-type. Otherwise, you'll cover phone number, website, etc and then a month later start getting duplicate issues like, "But what if I want to add [different] field to my map box?" And then this will start all over.
Comment #8
michfuer CreditAttribution: michfuer commented@RKS: I hear you with the generic fields, the only issue is that currently the library only supports the following store properties: 'title', 'address', 'phone', 'web', and 'misc'.
The good news is that the 'misc' property can be the default goto field when somebody wants to add a unique property.
Checkout the latest dev version to see the changes I've made. Now Store Location should have a phone, web, and misc. fields. Make sure to run update.php to get them.
Comment #9
RKS CreditAttribution: RKS commentedYeah I guess you would be limited to what Google will let you do. I wasn't considering that. But I think a misc field will be better than nothing at least.
Comment #10
endless_wander CreditAttribution: endless_wander commentedI approached this from the Views angle and was able to add fields to my display through the Location Export view that this module creates.
For example, I added "Phone Number" and "Website" fields to my content type. Then, I added these fields to the Location Export view, excluding them from display. (First, I made a clone of the Location Export view as a backup.)
Then, I used the "Rewrite Results" option in the View for the Address field and rewrote it like this:
The markup is just so I can style things as I wish, although you can use CSS to display:none anything you don't want to appear in either the address lists or the map popups.
Attached is a screenshot of how this looks for me. If anyone knows of any reason why messing with the view is a no-no, let me know. Far as I can tell, as long as the coordinates aren't tampered with, the map and locations work great.
Comment #11
jalves CreditAttribution: jalves commented#10 works for me too!
Thank you!
Comment #12
promarka CreditAttribution: promarka commented#10 works
I used the "Rewrite Results" option in the View for the gsl_feature_filter_list. The result is the result is attached.
Thank you!
Comment #13
brayo4 CreditAttribution: brayo4 commented