Forums / Setup & design / ez gmap location problem
Danny C
Friday 23 July 2010 8:45:53 am
Hi
I know this problem is an easy one, or think so anyway. I'm a new'b so go easy.
I'm using the ezgmaplocation extension which i have installed and using the attribute in a class, the map display's in the back end when i enter an address but i can't figure out how to display the map on the website. The solution has to be easy but i'm having some sort of mental block.
Any idea's
Cheers
Peter Keung
Friday 23 July 2010 8:51:02 am
If you've followed the steps from:
http://svn.projects.ez.no/ezgmaplocation/trunk/packages/ezgmaplocation_extension/ezextension/ezgmaplocation/README
The one thing remaining is probably to use something like this in the full view template for the appropriate class:
{attribute_view_gui attribute=$node.data_map.gmap}
... where "gmap" is the identifier of your ezgmaplocation attribute.
http://www.mugo.ca Mugo Web, eZ Partner in Vancouver, Canada
Thiago Campos Viana
Saturday 24 July 2010 10:59:39 am
I think he didn't get the api key as in step 4:
4.) Add your GmapsKey to the site.ini under [SiteSettings] like so:GMapsKey=<Long string of characters from Google>
You need to go to google maps api website ( http://code.google.com/apis/maps/signup.html ) and generate your key, if you has a localhost site, you enter "http://localhost" as your site address, or if it's a network computer, you enter the network computer name: "http://computer2"
So, google will generate your api key, and you will have to change your ini settings.
I think this extension needs some upgrade because version 3 of google maps api doesn't need an api key anymore.
eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924 Twitter: http://twitter.com/tcv_br
Monday 26 July 2010 5:05:40 am
Hi guys
Thank you for your reply's, I really appreciate it.
I have gotten the map to display and understand how to edit it, etc. which is great. But now i'm trying to override the template's for the map so i can customise it, This is what i've got:
[gmap] Source=content/datatype/view/ezgmaplocation.tpl MatchFile=gmapview.tpl Subdir=templates Match[attribute_identifier]=postcode
Not sure how override's work when it come to extensions.
Monday 26 July 2010 8:20:43 am
Is this right?
Match[attribute_identifier]=postcode
The default name of the Geo Article attribute is location, and did you put gmapview.tpl inside some override folder?
For more information you should go to documentation page:
http://ez.no/doc/ez_publish/technical_manual/4_x/templates/the_template_override_system
http://ez.no/doc/ez_publish/technical_manual/4_x/templates/the_template_override_system/template_override_example
http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_override_conditions
Monday 26 July 2010 8:54:19 am
Tried changing the attribute name but no change, and yes the gmapview.tpl is located in my override/templates/ folder
I've also tried the documentation but it's not giving me an answer, hmmm!
Interesting.
Monday 26 July 2010 9:12:41 am
ok, in this case you could make a backup of the original tpl file and direct edit it. It's not a good pratice but works.
Monday 26 July 2010 9:28:41 am
hey
Thanks, I'll do this for now until i can find an answer.
Monday 26 July 2010 9:32:24 am
I thought again about your problem and it should be an extension priority problem. the template of ez gmap extension has higher priority then your template extension, you could try change the order of the extensions in the settings/override/site.ini.append.php settings.
[ExtensionSettings]ActiveExtensions[]=yourdesignextension
..
ActiveExtensions[]=ezgmaplocation
You could also add the settings to match the class on your override settings and test again:
[gmap] Source=content/datatype/view/ezgmaplocation.tpl MatchFile=gmapview.tpl Subdir=templates Match[attribute_identifier]=locationMatch[class_identifier]=gmap_class_identifier
Tuesday 27 July 2010 2:37:03 am
Hey Thiago
I played around with those files, compied the override code you gave me and changed the names of the attribute and class names to my own and it worked. From there i said i'd do the reverse to see where the problem lay, so i took a part away and reloaded the page and repeated this but could not find the reason, It works with what i had previously.
I have a bad feeling there was a typo in there.
Anyway, it works!
Thanks for all your help