Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to...put custom js in head tag?How to...put custom js in head tag?
Previous
 
Next
New Post
2/28/2007 12:28 PM
 

Greetings:

I attempted to add a text/html module and put it in there...but that only puts it at the very top of the page.  I'm trying to put js there for the Google Maps API access (map key).

Thanks in advance for any assistance or guidance.

Ed in Tampa

 

 
New Post
3/1/2007 10:31 PM
 

Greetings...

Ok, I figured this out, maybe not the best way, as I've added a line in <head> to Default.aspx (below) which I'll have to remember to add again when I upgrade.  But now, the Google Maps API is avail to call from any page on the site. 

<script src=http://maps.google.com/maps?file=api&amp;v=2&amp;key=MYKEY type="text/javascript"></script>

Now, I've added a Text/HTML mod to a page and added javascript to generate a simple test map.  I know its able to connect/read via the Google API as I'm able to instanciate several Google objects and run the function GBrowserIsCompatible (which it passes and falls into the actual map generating calls).  Here's where I'm hitting another problem...the 2nd function call in the below (setCenter), doesn't generate a map.  In fact, in IE the browser session aborts; in FF the mod just remains blank.

mapObj = new GMap2(document.getElementById("mainMap"));
mapObj.setCenter(new GLatLng(27.946609, -82.458366), 13);

Below, find the entire code snippet in the mod:

<DIV id=mainMap style="WIDTH: 600px; HEIGHT: 400px">Google Map</DIV>
<SCRIPT type=text/javascript>
var mapObj;
var geocoder = new GClientGeocoder(); // Comes with client-side cache
var request = GXmlHttp.create();

if (GBrowserIsCompatible())
{
mapObj = new GMap2(document.getElementById("mainMap"));
mapObj.setCenter(new GLatLng(27.946609, -82.458366), 13);
}
else
{
// Determine what to do in this situation...
document.write('Browser not compatible with Google Maps...');
}
</SCRIPT>

Thanks in advance for any and all guidance.

Ed in Tampa

 
New Post
3/2/2007 9:46 AM
 

Greetings:

An associate of mine suggested putting the mapping code into an Iframe as the Google Map doesn’t like to be embedded in tables (which is where that code would be if used within a Text/HTML module. In fact, perhaps the DNN Iframe module can be used for this?

Thanks for any advice or guidance.

Ed in Tampa

 
New Post
3/2/2007 4:23 PM
 
I found it much easier to use the Bi4ce GoMap module available at http://dnn.bi4ce.com/Default.aspx?tabid=155. Have a look at it in operation on my site (below) on the Contact Us tab.
 
New Post
3/3/2007 8:35 AM
 

Hey Jeff:

Yes, thanks for that tip...I may very well use that module as it looks like it has functionality I'll want for my next goal; db integration.

Anyway, I was successful this morning in getting a single hard-coded Google Map to generate within a DNN Text/HTML module.  The trick was not to try to generate directly on that module, but rather, simply perform that task on another page (ASP) and call it via an IFrame tag.  Apparently, Google Maps do not function well when inbedded within a bunch of other tags...they are sensitive about it.

Also, I removed my reference in the Default.aspx to the Google API; I was a bit uncomortable about having it there in a core DNN page.  The API call now happens in the hidden ASP page displayed by the IFrame tag in the module.

Gday mate.

Ed in Tampa

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to...put custom js in head tag?How to...put custom js in head tag?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out