Before asking for help please read "How to request help" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

Embeding google map to FAQ page 2 weeks 6 days ago #1

  • moyra777
  • moyra777's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
Is it possible to embed a tailored google map to HTML area on the main page or faq element? I tried to copy HTML code into a source code but it doesn't work or I am doing something wrong? I checked it does work on other websites and in the online HTML editor.
thank you
Agnieszka

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 5 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13892
I guess that you tried to include javascript in the HTML block - and this was removed by the "safety filter".

If you need to add javascript, you could add it using the module: "Custom css and js"
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 5 days ago #3

  • moyra777
  • moyra777's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
Thanks Greg :)
that could explain I was wondering if that was CSS...

I guess I took too literally - "paste HTML" in the source code for your page.

Agnieszka
Attachments:

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 5 days ago #4

  • hermann
  • hermann's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 215
<iframe> is html and not CSS or javascript, but again the "safety filter" removes embedded iframes.
webtrees 2.0.11 (all available custom modules installed) @ ahnen.hartenthaler.eu/
and webtrees 1.7.17 (many custom modules) @ ahnen1.hartenthaler.eu/

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 5 days ago #5

  • moyra777
  • moyra777's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
Thanks :) is then there a way to "mask" iframe? in other words is there a way to add iframe or that is not possible?

Please Log in or Create an account to join the conversation.

Last edit: by moyra777.

Embeding google map to FAQ page 2 weeks 4 days ago #6

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13892
I didn't realise you were using an IFRAME. (I assumed you were adding a DIV element, and using JS to initialise it.)

> is then there a way to "mask" iframe? in other words is there a way to add iframe or that is not possible?

Only specific HTML elements are allowed.

There are two levels of HTML filtering.

1) The interactive HTML editor will only allow certain elements, attributes, etc.
2) On the server, we also use the HTMLPurifier library (because a malicious user could bypass the HTML editor checks).

To modify the code to allow this, you would need to modify two files

1) HtmlService::sanitize()
2) resources/views/modules/ckeditor/ckeditor-js.phtml

Are iframes safe? Sometimes...
If you do not control the contents of the remote site, then there are many risks.

A common use for iframes is to load adverts. There have been many instances where advert-servers have sent malicious content.

An alternative suggestion is to create a module (e.g. "googlemap-in-iframe block") which just contains the iframe.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 4 days ago #7

  • moyra777
  • moyra777's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
Thanks, Greg, for sure I do not want to use something which may impair the security of the site, and by saying "mask" I had in mind a container which would "present" map with layer, but from what you wrote that this would require a new module to be created. Well, certainly I am not there yet ;) Would have to find another way to present parish structure.

Please Log in or Create an account to join the conversation.

Embeding google map to FAQ page 2 weeks 4 days ago #8

  • Sir Peter
  • Sir Peter's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 66
I have NOT tested this with webtrees, but on a different website. Nevertheless this might lead you into the right direction. Add the following code to your webtrees site using the module "Custom css and js". The first JavaScript will be loaded from Microsoft's Bing Maps website. The second JavaScript defines your map and requires the creation of a Bing Maps account and a Bing Maps key to display it nicely. You can play with the coordinates and the zoom factor to taylor the map display to your liking.
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap' async defer></script>
     
<script type='text/javascript'>
var map;
function GetMap()
{
   map = new Microsoft.Maps.Map('#myMap', {
      credentials: 'Agnieszka's Bing Maps Key',
      center: new Microsoft.Maps.Location(51.50632, -0.12714),
      mapTypeId: Microsoft.Maps.MapTypeId.aerial,
      zoom: 10
   });
}
</script>
Then add the follwoing HTML container code to your FAQ page.
<div id="myMap" style="position:relative;width:600px;height:400px;"></div>
This example will (hopefully) display a Bing Map with the City of London in the center and (most probably) a warning that your Bing Maps key is not registered. More information is available at docs.microsoft.com/en-us/bingmaps/gettin...ting-a-bing-maps-key

Please let us know about your progress. Good luck!
Peter

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Embeding google map to FAQ page 2 weeks 4 days ago #9

  • hermann
  • hermann's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 215
It works great!
webtrees 2.0.11 (all available custom modules installed) @ ahnen.hartenthaler.eu/
and webtrees 1.7.17 (many custom modules) @ ahnen1.hartenthaler.eu/

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum