Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

trouble inserting google map


Reply


3 Posts   1063 Views

Avatar
janulka

Community Member, 80 Posts

22 September 2011 at 10:36pm

I am inserting simple iframe google code into html code in the editor. But after publishing, the whole content after the iframe disappears and the html tags after <iframe ... /> are changed to "... /&gt;&lt;/td&gt; &lt;td&gt;&lt;br mce_bogus="1" /&gt;&lt;/td&gt; &lt;/t..." in html editor

this is what I am trying to insert:

<table style="width: 593px; height: 261px;" border="0">
<tbody>
<tr>
<td colspan="2">
<h1>Adresser:</h1>
</td>
<td rowspan="4">

<iframe src="http://maps.google.no/maps?f=q&amp;source=s_q&amp;hl=no&amp;geocode=&amp;q=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,+5750+Odda&amp;aq=0&amp;ie=UTF8&amp;hq=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,&amp;hnear=Odda,+Hordaland&amp;t=m&amp;vpsrc=6&amp;ll=60.08779,6.549568&amp;spn=0.059922,0.145912&amp;z=12&amp;output=embed" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<a style="color:#0000FF;text-align:left" href="http://maps.google.no/maps?f=q&amp;source=embed&amp;hl=no&amp;geocode=&amp;q=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,+5750+Odda&amp;aq=0&amp;ie=UTF8&amp;hq=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,&amp;hnear=Odda,+Hordaland&amp;t=m&amp;vpsrc=6&amp;ll=60.08779,6.549568&amp;spn=0.059922,0.145912&amp;z=12">Vis større kart</a>

</td>
</tr>
<tr>
<td>
<p><span style="text-decoration: underline;">Postadresse:</span></p>
<p>H&oslash;yer Odda as</p>
<p>Postboks 153</p>
<p>5751 Odda</p>
</td>
<td>
<p><span style="text-decoration: underline;">Bes&oslash;ksadresse:</span></p>
<p>H&oslash;yer Odda as</p>
<p>Eitrheim Industriomr&aring;de</p>
<p>5750 Odda</p>
</td>
</tr>
</tbody>
</table>
<h1>Kontaktskjema</h1>
<p>$UserDefinedForm</p>

and this is what happens in html after I save the page:

<table style="width: 593px; height: 261px;" border="0">
<tbody>
<tr>
<td colspan="2">
<h1>Adresser:</h1>
</td>
<td rowspan="4"><iframe src="http://maps.google.no/maps?f=q&amp;source=s_q&amp;hl=no&amp;geocode=&amp;q=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,+5750+Odda&amp;aq=0&amp;ie=UTF8&amp;hq=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,&amp;hnear=Odda,+Hordaland&amp;t=m&amp;vpsrc=6&amp;ll=60.08779,6.549568&amp;spn=0.059922,0.145912&amp;z=12&amp;output=embed" width="425" height="350" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"> &lt;a style="color:#0000FF;text-align:left" mce_style="color:#0000FF;text-align:left" href="http://maps.google.no/maps?f=q&amp;amp;source=embed&amp;amp;hl=no&amp;amp;geocode=&amp;amp;q=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,+5750+Odda&amp;amp;aq=0&amp;amp;ie=UTF8&amp;amp;hq=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,&amp;amp;hnear=Odda,+Hordaland&amp;amp;t=m&amp;amp;vpsrc=6&amp;amp;ll=60.08779,6.549568&amp;amp;spn=0.059922,0.145912&amp;amp;z=12" mce_href="http://maps.google.no/maps?f=q&amp;amp;source=embed&amp;amp;hl=no&amp;amp;geocode=&amp;amp;q=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,+5750+Odda&amp;amp;aq=0&amp;amp;ie=UTF8&amp;amp;hq=H%C3%B8yer+Odda+AS,+Eitrheim+Industriomr%C3%A5de,&amp;amp;hnear=Odda,+Hordaland&amp;amp;t=m&amp;amp;vpsrc=6&amp;amp;ll=60.08779,6.549568&amp;amp;spn=0.059922,0.145912&amp;amp;z=12"&gt;Vis st&oslash;rre kart&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;p&gt;&lt;span style="text-decoration: underline;" mce_style="text-decoration: underline;"&gt;Postadresse:&lt;/span&gt;&lt;/p&gt; &lt;p&gt;H&oslash;yer Odda as&lt;/p&gt; &lt;p&gt;Postboks 153&lt;/p&gt; &lt;p&gt;5751 Odda&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;span style="text-decoration: underline;" mce_style="text-decoration: underline;"&gt;Bes&oslash;ksadresse:&lt;/span&gt;&lt;/p&gt; &lt;p&gt;H&oslash;yer Odda as&lt;/p&gt; &lt;p&gt;Eitrheim Industriomr&aring;de&lt;/p&gt; &lt;p&gt;5750 Odda&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h1&gt;Kontaktskjema&lt;/h1&gt; &lt;p&gt;$UserDefinedForm&lt;/p&gt;</iframe></td>
</tr>
</tbody>
</table>

can someone plz help me what is the best way how to integrate google map in page content?

Avatar
lanks

Community Member, 61 Posts

23 September 2011 at 7:59pm

Hi

I don't know what your exact requirements are but it may not be the best idea to use the CMS content to insert Google maps. Obviously this depends on where you are getting the data displayed on the map from. If the data can be stored in Silverstripe then there are some modules that allow you to display Google Maps with Silverstripe.

Here are a few modules that you may find useful for what you are trying to achieve:
http://www.silverstripe.org/map-pages-module/
http://www.silverstripe.org/locations-module/
http://www.silverstripe.org/google-map-basic-module/
http://www.leftandmain.com/silverstripe-tutorials/2011/06/14/new-mappable-module-and-some-unsolicited-programming-pedagogy/

If modules aren't the answer to your requirements then another way to use the "Content" in the CMS would be to add a TinyMCE plugin for Google Maps. There are some steps to doing this [url=http://deadlytechnology.com/silverstripe/add-google-maps/]here[/url].

Liam

Avatar
janulka

Community Member, 80 Posts

23 September 2011 at 8:58pm

Thanks a lot for your reply!

The extensions were all I found as well. The map must be inserted in Content area, then only TinyMCE plugin was the idea, but then this did not allow for using for example another language.

Today I found out I did wrong search in forums. I searched "google map", not "iframe". Iframe returned that many more had same issue, and I found solution as well:

http://www.silverstripe.org/general-questions/show/16438

:)