weather forecast cannot be displayed on html block

weather forecast cannot be displayed on html block

by Cesar Romo -
Number of replies: 3

I have recently installed moodle (1.9) under ubuntu. I would like to display the weather forecasting using an html block. There is a fancy site (http://netweather.accuweather.com/signup-page1.asp?partner=&traveler=0) who provides you with the html code in order to get the corresponding forecast dinamically. When I pasted this code in the block (I made sure Toggle HTML source was set ), it only displays a frame (including its background) but no text is shown.

This is the code...

<div style='width: 180px; height: 150px; background-image: url( http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/clouds_180x150_bg.jpg ); background-repeat: no-repeat; background-color: #;' ><div style='height: 138px;' ><script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=normal&logo=1&zipcode=NAM|MX|MX001|AGUASCALIENTES|&lang=esp&size=8&theme=clouds&metric=1&target=_self'></script></div><div style='text-align: center; font-family: arial, helvetica, verdana, sans-serif; font-size: 10px; line-height: 12px; color: #;' ><a style='color: #' href='http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=NAM|MX|MX001|AGUASCALIENTES|&metric=1' >Weather Forecast</a> | <a style='color: #' href='http://www.accuweather.com/maps-satellite.asp' >Weather Maps</a></div></div>

Any idea what could be the issue? I have tried using other code from other sites and it works fine.

Thanks in advance.

Average of ratings: -
In reply to Cesar Romo

Re: weather forecast cannot be displayed on html block

by Cesar Romo -
I have just realized that this code tries to show active content. Then, I guess somehow moodle is preventing to display it correctly thru html block. Any idea or note where could explain how to enable it?
In reply to Cesar Romo

Re: weather forecast cannot be displayed on html block

by Chris Potter -

I don't know if this is a good thing or not, but I've had a bit of success running a weather block by toggling on the HTML source in the editor, pasting the code, and then clicking save (don't toggle back the editor to normal mode). If you go back in to edit it, it might break...

Give that a try and let us know.

[Update]:

I was able to copy/paste your code into an HTML block on my site and make it work using the instructions I gave above. smile

Average of ratings: Useful (1)
In reply to Chris Potter

Re: weather forecast cannot be displayed on html block

by Cesar Romo -
Thanks Chris ... it worked as you explained!.. Best Regards.