Documentation

Generate: Dynamic Elements: OpenWeatherMap

Documentation »

Page Generator Pro » Generate: Dynamic Elements: OpenWeatherMap

The OpenWeatherMap shortcode inserts an OpenWeatherMap Forecast, depending on the shortcode’s parameters.

Adding: Classic Editor / TinyMCE

To add an OpenWeatherMap within the Classic Editor:

  • Ensure that you’re using the Visual Editor by clicking the Visual tab:
    Page Generator Pro: Dynamic Elements: TinyMCE: Visual Editor Tab
  • Click the OpenWeatherMap icon in the Visual Editor toolbar:
    Page Generator Pro: Generate: Dynamic Elements: OpenWeatherMap: TinyMCE Icon

Adding: Classic Editor / TinyMCE: Text Editor

If you’re using the Text editor instead of the TinyMCE Visual Editor above:
Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor Tab

  • Click the Open Weather Map button in the toolbar:
    Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor: Buttons

Adding: Gutenberg

To add an OpenWeatherMap within Gutenberg:

  • Click the plus icon between two existing blocks, or towards the top left corner of the Gutenberg editor
    Page Generator Pro: Generate: Dynamic Elements: Gutenberg: Add Block
  • Start typing Open Weather Map into the Search for a block field, and click the Open Weather Map option that appears within the Page Generator Pro section
    Page Generator Pro: Generate: Dynamic Elements: Open Weather Map: Search Blocks
  • Follow the Configuration section below for each of the fields displayed in the right hand sidebar’s block panel:
    Page Generator Pro: Generate: Dynamic Elements: Open Weather Map: Sidebar

Adding: Page Builders

To add an OpenWeatherMap within any Page Builder that supports a Text Editor widget/module using the Classic Editor (sometimes known as TinyMCE), refer to the Classic Editor instructions above.

Refer to the Dynamic Elements Documentation for details specific to your Page Builder.

If your Page Builder does not provide a Text Editor widget/block that uses the Classic Editor, you can still use Dynamic Elements.  However, you’ll need to manually build the shortcode, inserting it into your Page Builder’s content – for example:

[page-generator-pro-open-weather-map parameter="value" ...]

ParameterAccepted ValueDescription
forecast_typeintegerThe weather forecast style to display. Refer to the below table for sample output of each.
locationstring or keywordThe location to display the marker on the map
countrystring or keywordThe country that the above location is in
unitsimperial,metricThe temperature display:
– imperial: Farenheight
– metric: Celcius

Configuration

Page Generator Pro: Generate: Shortcodes: Open Weather Map: TinyMCE Modal

  • Forecast Type: Select the type of weather forecast to display
  • Location: Enter the City, County or State/Region (or keyword, if you have one that has keyword data comprising of this location data).
    • If entering a ZIP Code, the weather for the ZIP Code’s City will be displayed.  This is by design, and how OpenWeatherMap widgets function.
  • Country: Select the Country the above Location is in.
  • Units: Select whether to display the forecast in Imperial (Farenheight) or Metric (Celcius)
Support for ZIP Codes is available in Page Generator Pro 3.3.0, releasing Thursday July 1st 2021 23:59 UTC

Forecast Types

Refer to the below table for sample output of each available weather forecast type:

Forecast TypeShortcode ValueExample Output
Small13
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Small
Medium16
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Medium
Medium with Details17
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Medium with Details
Large12
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Large with Details
Large with Details11
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Large
Banner18
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Banner Alternative
Banner Alternative19
Page Generator Pro: Shortcode: OpenWeatherMap: Forecast Type: Banner

Configuration: Errors

The Errors section is available in Page Generator Pro 4.9.3 and higher, releasing Monday January 6th 2025 23:59 UTC.  Ensure that your license is valid, not expired and that you’ve updated to the latest version of the Plugin.
Page Generator Pro: Dynamic Elements: Errors

Ignore Errors

If enabled, an error returned from the Dynamic Element will result in blank content output, instead of an error preventing generation of the entire Page / Post / Custom Post Type.

This setting may be useful if you don’t require the Dynamic Element to always return content output.

This setting is ignored when using Test mode. If the Dynamic Element produces an error, it will always be reported in Test mode, to assist with debugging.


Published

Last Updated