Posted by tinem on June 6, 2009 at 1:10pm
I'm surprised that I just can copy the code from for instance this site http://www.tinemuller.dk/googlemap/her_bor_jeg/ and just paste it in a Node and then it's functioning http://www.tinemuller.dk/drupal/node/718.
I'm new to Drupal so don't really know how the system is build but when I do it this way will there not be 2 html and head codes but maybe this doesn' matter?
The only thing I had to change was to make the links to the images from the first map absolute.
But what doesn't work now is the tabbed infowindow but don't know how to make it work. Can some one help, please?
Comments
Yes, it seems to work when
Yes, it seems to work when you just copy the html, but the result is not valid html: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.tinemuller.dk%2Fdrupa.... Two html tags in one page is not allowed and invalid html may cause javascript to break. I'm not a google maps expert and I don't know exactly what you want to achieve, so it's hard for me to tell you what to do. To cut-and-paste html may not be the best solution, maybe it's a good to have a look at the gmap module (http://drupal.org/project/gmap).
Thanks for trying to help. I
Thanks for trying to help. I have now removed some of the code but it didn't help. Everything is functioning though but NOT when you click Foto - you can click on my first map to see what should happen.
Maybe it's only a little thing to change when javascript is used inside a Note?
I have tried to figure out gmap but it's not easy to use it as I have outside Drupal.:-(
I have used it on Node locations and User locations.
Is there somewhere it's
Is there somewhere it's explained how to use javascript in a Node inside Drupal easy to understand, please?
Is it ONLY functioning if I link to a javascript outside Drupal as I do here http://www.tinemuller.dk/drupal/node/715?
IIRC, Drupal filters out
IIRC, Drupal filters out javascript because of security reasons. I read somewhere that is would be a solution to print the javascript using php. Personally, I would add the javascript by using the drupal_add_js function (http://api.drupal.org/api/function/drupal_add_js/6) inside the MYTHEME_preprocess_node function of my theme's template.php after checking for the node id, ie:
<?phpfunction MYTHEME_preprocess_node(&$vars){
if($vars['node']->nid == 715){
drupal_add_js(drupal_get_path('theme', 'MYTHEME') . 'myscript.js');
}
}
?>
I have used php from the
I have used php from the start. But thanks for trying to help.
I found a solution myself. I changed some of the CSS code and now everything is working beautifully.
/Tine