Forums Index > Mewsoft > Documentations > Weather Widget
mewsoft First Post Posted on: 01-30-20 07:51 AM
Weather Widget

The weather widget can be called from any template or another widget, currently used on the Frontpage.html template using the code:

[ widget::Weather(location="[ plugin::UserZip],[ plugin::UserCity],[ plugin::UserState],[ plugin::UserCountry]", default="37909", unit="f", cache="60") ::]

you can pass to the widget the location and a default location, the temperature unit, and the cash time.

The location is used if the user is logged in, the default location is used if the user is not logged in or no address set in the location.

Both the location and the default variables can be either the full location address cit, state, country, etc, or zip code.

The plugins above will be filled with the current user information if logged in and will be empty if no user is currently logged in.

This allows the widget to display the current logged in user are weahter information or a default location weather for none logged in users.

The cash variable (in minutes) set the time to cash results instead of getting the  weather informatin from the provider site (google, yahoo, etc), zero value for the

cash disable the cash. Set this to a resonable time (in minutes) to avoid blocking by the weather providers thinking it may be an attack to their systems.

The unit sets the temperature unit either "c" for Celsius or "f" for Fahrenheit.


Mewsoft Support