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.
Sorry if this have been asked before and maybe it's a dumb question:
But is it possible to output the Google Store Locator in a block instead of using the store-locator page?
Can someone give me some tips how I can make this possible?
Comment | File | Size | Author |
---|---|---|---|
#12 | google_store_locator-block-2634376-12.patch | 5.45 KB | natanmoraes |
#11 | gsl-defaultblock-2634376-11.patch | 815 bytes | mrP |
#6 | Schermafbeelding 2015-12-21 om 13.34.48.png | 27.44 KB | fotograafinge |
#3 | gsl_block.zip | 989 bytes | atiba |
Comments
Comment #2
fotograafinge CreditAttribution: fotograafinge commentedI wondered the same. I need a block that I can display on multiple pages. But making a block in the store-locator view, only shows sore data but no map.
Comment #3
atiba CreditAttribution: atiba commentedI'm changing this issue from 'Support request' to 'Feature request' because I think a lot of people like to see the store locator in a block. It's also suggested here.
Therefore, it's easy to implement so why not right? :)
I got the store locator working in a block by making a custom module.
I'm not a module developer so my module is far from perfect but it works. So fotograafinge, if you're in a hurry and really need your store locator in a block - You can give my custom module a try.
Comment #4
fotograafinge CreditAttribution: fotograafinge commentedThnx Atiba ! It does the trick :-) Maybe not perfect to a module developer, which I'm also not. But for me it's great !!!
Thanks again.
EDIT: I responded too quickly. The page is now shown as a block, but the page itself is gone. And ... my stores won't show. The throbber stays on "loading". So I only see the map and my current location, but the stores aren't loaded somehow.
And yes, this seems like a much needed feature for a lot of people.
Comment #5
atiba CreditAttribution: atiba commentedHmm, my custom module doesn't alter the store-locator page. It just uses the callback function of the Google Store Locator module that generates the content and puts it in a block. Did you clear the cache and run cron?
Also, check the block permissions of the Google Store Locator. Be sure to select "All pages except for...". I hope it helps.
Comment #6
fotograafinge CreditAttribution: fotograafinge commentedI cleared the cache, I ran cron, ... and I logged out and back in, and now the store locator page is back.
My block has the right permissions. But it only show the map. And the map moves to my locaties (or the location I type in). But the stores don't show. There it keeps showing "loading". (or "laden" in dutch)
I had a problem with this on my page when I installed GSL, but with a patch from https://www.drupal.org/node/2528458 I got it working. Maybe that is causing issues?
Comment #7
fotograafinge CreditAttribution: fotograafinge commentedI found what is causing the problem in the block
F.e. when the block was displayed on node/5, it was looking for the Location Export View dealers/json (original name was dealer-locator/json, but I changed that) but relative to node/5 en not relative to my site.
GET http://localhost:3000/node/5/dealers/json 404 (Not Found)
Solution: I changed Path to Store Location data to /dealers/json (I forgot the /) in my advanced setting for the GSL module. Everything works fine now !!
(everyone can make stupid mistakes ;-))
Comment #8
atiba CreditAttribution: atiba commentedMaking mistakes is a good thing! Hah.
Good to know it's working fine now!
Comment #9
mrP CreditAttribution: mrP commentedAdding a default block to this module is a great idea for increasing its flexibility.
Comment #10
mrP CreditAttribution: mrP commentedAttached is a patch based on @atiba's work in #3 to provide a block that renders the output of the google store locator page.
Comment #11
mrP CreditAttribution: mrP commentedResubmitted to remove tab.
Comment #12
natanmoraesI've re-rolled the patch
Comment #14
rodrigoeg CreditAttribution: rodrigoeg at CI&T commentedPatch applied to latest dev version
@natanmoraes, I have made some small changes to your patch, only to keep the array instantiation consistent in the module.