Module Installation
For installing the module i think it's better to show a video than putting a lot of text. So
here's a good example created by Chris Hammond on the Dotnetnuke site.
Module Usage
DnnWeather Module can be used in two ways, has a page module or as a skin object.
Has a Page Module
After adding a module to a page, you should go to the module settings and go to DNNWeather Settings and configure the following:
- First set the Location to be show by:
- Click on the button "Change/add Location"
- A box will show asking the city name, there you will enter for example Lisbon (my city :))
and click go - If there's only only one location with that name automatically, the module will be set to show it, else a drop will appear with the found results. You will select one of the results and press go
- On the text box field for "City display name", you have an option to show an alternative name for the location selected
- Second set which template to use. Two options are shown:
- Service Default - use yahoo's template for weather
- Custom Template - Select one from the list of existing templates that come with the module.
If you want to add more, just go to the module folder path\Documentation\Templates\Custom and create a copy of the TemplateComplete.htm (this one has all the options) and change it has you like
- Third Additional Settings (Optional)
- Set the Degree units has Celsius or Fahrenheit
Has a SkinObject
Go to the skin you want to change and do the following:
- On the top of the skin following the last module registration add the following line:
<%@ Register TagPrefix="dnn" TagName="DNNWEATHER" Src="~/DesktopModules/DNNWeather/ViewWeatherSO.ascx" %>
This will register the module - Than where you want it to show, add:
<dnn:DNNWEATHER runat="server" CityId="FRXX0076" CityName="Lisboa" Template="\Documentation\Templates\Custom\TemplateNoImages.htm" DegreeUnits="c" id="dnnWeather" />
The possible attributes are:
- CityId (Required) - you will add the id of the city you will want to add.
Go to weather.com, and in the search field enter the city you want (ex: Lisbon, a autocomplete options will show, i selected Lisbon, Portugal), and in the weather forecast page, copy from the url the city code, for example in the url -
http://www.weather.com/weather/today/Lisbon+POXX0016:1:PO the code is POXX0016
- CityName (Required) - Enter the name for the city
- Template - the url for the template. If nothing is added, it will default to the yahoo template
- DegreeUnits - Enter c for Celsius or
f for Fahrenheit. If nothing is added it will default to celsius
Hope you all found it usefull. Any sugestions or situations found please fill free to post into the Discussions/Issue Tracker page.