Generate: Dynamic Elements: Wikipedia Content

Overview

The Wikipedia shortcode inserts text from Wikipedia about a given term (topic).

It can be used anywhere on a Content Group where shortcodes are processed, including Page Builders.

Adding: Classic Editor / TinyMCE

To add a Wikipedia article 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 Wikipedia icon in the Visual Editor toolbar:
    Page Generator Pro: Generate: Dynamic Elements: Wikipedia: 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 Wikipedia button in the toolbar:
    Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor: Buttons

Adding: Gutenberg

To add a Wikipedia article 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 Wikipedia into the Search for a block field, and click the Wikipedia option that appears within the Page Generator Pro section
    Page Generator Pro: Generate: Dynamic Elements: Wikipedia: 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: Wikipedia: Sidebar

Adding: Page Builders

To add a Wikipedia article 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-wikipedia parameter="value" ...]

Parameter Accepted Value Supports Keywords? Description
term string Yes Wikipedia Article to display.
Multiple Terms must be separated by a semicolon ;
use_similar_page 0 or 1 No Whether to fetch a related / similar page when Term(s) are ambiguous
language string No Two character language code.
sections string No Sections to fetch Wikipedia Page content from, based on the Table of Contents.
Multiple Sections must be separated by a semicolon ;
elements paragraphs
headings
lists
tables
images
No Elements to fetch from the Wikipedia Page content.
Multiple Elements must be separated by a comma ,
remove_links 0 or 1 No If enabled, any links found in the Wikipedia content will be stripped.  Link text will remain.
paragraphs integer No The maximum number of elements to output, based on the aggregate of all content fetched from the above sections.
apply_synonyms 0 or 1 No If enabled, common words from the Wikipedia content will be replaced by multiple synonyms (similar words) in spintax format.  The spintax is then automatically spun.

Configuration: Search Parameters

Page Generator Pro: Dynamic Elements: Wikipedia: Search Parameters

Term(s) / Wikipedia URL(s)

Specify one or more Terms or exact Wikipedia URLs to search Wikipedia.

Keywords are supported in the Term(s) field.

Where multiple Terms / URLs are specified, searching is performed in the order specified.  Once a matching article is found for a Term / URL, searching stops.  Therefore, it’s recommended that you specify the most exact Term / URL first, through to the least exact Term last (which acts as a fallback should no content be found for more precise Terms).

Specifying multiple Terms does not mean that content is collated from multiple articles.

To add a Term:

  • Start typing in the Term(s) field
  • Either click the ‘Add’ option which appears below the field, or press the Enter key
    Page Generator Pro: Generate: Shortcodes: Wikipedia: Add Term
  • Repeat for any additional Term(s) that you may wish to search for on Wikipedia

To re-order Terms (which determines the search order):

  • Drag and drop a Term to the left or right as necessary

To delete a Term, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of a Term, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Term.

Use Similar Page

If enabled, a similar Wikipedia Article will be used where an ambiguous Term (or Term in a list of Terms) was specified, and Wikipedia provides alternate Articles when viewing said Term.

For example, using the Term Live Oak, California returns the following links, with https://en.wikipedia.org/wiki/Live_Oak,_California itself not containing any meaningful content:

Page Generator Pro: Generate: Wikipedia: Use Similar Page

With the Use Similar Page option enabled, Page Generator Pro will use the second link (the first being in red, meaning that it too has no content).

Language

The language to use when searching and outputting the Wikipedia content.

Configuration: Output

Page Generator Pro: Dynamic Elements: Wikipedia: Output

Sections

Optionally specify one or more specific sections of the Wikipedia article to fetch content from that might be found in Wikipedia’s Contents table for each article.

If no sections are defined, the “summary” (content before Wikipedia’s Contents table) will be used.

For example, if our Term is {city}, many Wikipedia City pages contain History, Geography and Demography:
Page Generator Pro: Shortcodes: Wikipedia: Sections

We could therefore enter History,Geography,Demography into the field.

Keywords are supported in the Section field.

Where multiple Sections are specified, they will be output in the order specified.

To add a Section:

  • Start typing in the Section field
  • Either click the ‘Add’ option which appears below the field, or press the Enter key
  • Repeat for any additional Sections that you may wish to fetch content from

To re-order Sections (which determines the output order):

  • Drag and drop a Section to the left or right as necessary

To delete a Section, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of a Section, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Section.

Elements

The Elements option is available in Page Generator Pro 2.7.1, releasing Thursday 25th June 2020 23:59 UTC.

When used, the Elements option will return the content formats specified:

  • Paragraphs
  • Headings
  • Lists
  • Tables
  • Images

For example, if we want to return both headings and paragraphs

  • Click on the Elements field
  • Select Headings from the dropdown list

To add an Element type

  • Click on the Elements field
  • Select the applicable Element type you want to include from the dropdown list

To delete an Element type, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of an Element, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Element.

Remove Links?

If enabled, any links found in the Wikipedia content will be stripped.  Link text will remain.

Limit

The maximum number of elements to output after all defined sections and elements have been fetched and combined.

This limit applies as a whole, not to individual sections.

Output Source Link?

The Output Source Link option is available in Page Generator Pro 2.7.7, releasing Thursday 13th August 2020 23:59 UTC.

If enabled, a nofollow link will be displayed below the Wikipedia article’s text on generated pages.

Source Link Text

The Source Link Text option is available in Page Generator Pro 2.7.7, releasing Thursday 13th August 2020 23:59 UTC.

If Output Source Link is enabled, the text for the source link can be modified.

Spin?

If enabled, common words from the Wikipedia content will be replaced by multiple synonyms (similar words) in spintax format.  The spintax is then automatically spun.

Common Issues

Term(s) / URL(s) Field Value not Saving in Gutenberg
Sections Field Value not Saving in Gutenberg

If you’re using Gutenberg with the Wikipedia Block, you need to:

  • Type the value in the Term(s) / URL(s) or Sections Field:
    Page Generator Pro: Dynamic Elements: Wikipedia: Gutenberg: Terms / URLs Input
  • Press the Enter key on your Keyboard; the Term / URL / Section will then be stored, denoted in a grey bubble:
    Page Generator Pro: Dynamic Elements: Wikipedia: Gutenberg: Terms / URLs Save
  • To add additional value(s), repeat the above steps.
  • To delete an existing value, click the cross button.

Incorrect content output on Generation

It’s strongly recommended to use a clear, specific Term, particularly if the Term references a place or name that has multiple meanings or exists in multiple places.

For example:

  • Birmingham would result in the content from https://en.wikipedia.org/wiki/Birmingham being used (that is, Birmingham, England, UK).
  • However, if the content required should be fetched from Birmingham, Alabama, you must use a more specific Term (e.g. Birmingham, Alabama).

No content output on Generation

Sometimes, the Wikipedia shortcode won’t return any content for given Term(s).  If you’d like to increase the chances of content being returned:

  1. Run generation in Test mode for the problematic Term.  If the Term is from a Keyword, either:
    1. Use the Resume Index to force the Test method to use the appropriate keyword,
    2. Use the Keyword Index to force the Keyword Index within the shortcode,
    3. Replace the Keyword with the Term itself within the shortcode
  2. Make a note of the verbose output from the Test draft Page:
    Page Generator Pro: Generate: Shortcodes: Wikipedia: Verbose Errors on Testing

Depending on the output above, refer to the below resolutions available:

Issue Resolution
The page you specified doesn’t exist Use a different Term, or specify multiple Terms that can act as a fallback.
No paragraphs could be found in the sections [Sections]
  • Specify valid Sections, by inspecting the Table of Contents for the Wikipedia Article.  Include “summary” as a section, or don’t specify any sections to ensure some content can be found and returned.
  • If valid Sections are specified, ensure that the Term is precise, including capitalization.
The Term [Term] is ambiguous and could relate to one of several articles available on Wikipedia. Enable the Use Similar Page option, to allow the shortcode to use one of the similar articles.