Skip to content

Wikipedia

jurialmunkey edited this page Mar 19, 2023 · 5 revisions

Wikipedia Scripted Window

TMDbHelper v5+ provides a scripted window to allow users to browse wikipedia

Create the following xml dialog in your skin

script-tmdbhelper-wikipedia.xml
<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog">
    <defaultcontrol always="true">9902</defaultcontrol>
    <controls>
        <!-- CONTENT GOES HERE -->
    </controls>
</window>

Required Controls

ID Type Description
9901 label Title of the Wikipedia article
9902 list List of sections containing the table of contents. Scrolling the list changes text loaded in the section textbox 9903. Clicking a listitem opens a select dialog for page links in the section
9903 textbox Textbox with the text of the section focused in 9902
9904 label Creative commons attribution label. REQUIRED! You MUST display this text as per Wikipedia licensing requirements
9905 image Creative commons licence logo. The license logo is optional as long as you display the attribution label
61 scrollbar Page control for section textbox. Clicking the scrollbar will pop-up select dialog for page links in the section

Window Properties

Property Description
Window.Property(Backdrop) First result found on wikimedia commons for search term with landscape aspect. Not always accurate but can be useful to use in place of background fanart. This image is aliased to Window(Home).Property(TMDBHelper.Wikipedia.Backdrop) if you need to use it in a window underneath the dialog.
Window.Property(Image) If the current section has an image, the first image will be added to this property. Otherwise it gets the first image for the page
Window.Property(ImageText) The alt text for the image which is displayed on wikipedia for vision impaired users or when the image does not load

Changing Tag Formatting

As of v5.1.8 HTML tags formatting can be modified via a skin string TMDbHelper.Wikipedia.Format.TAG

For example, to change all hyperlinks to red: Skin.SetString(TMDbHelper.Wikipedia.Format.Link,[COLOR=red]{}[/COLOR])

String Suffix HTML Tags
.Link <a href=>
.Bold <hx> <b> <th> and class:mw-headline
.Emphasis <em> <i>
.Superscript <sup>

Opening / Searching

RunScript(plugin.video.themoviedb.helper,wikipedia=SEARCHTERM)

Searches wikipedia for the search term and provides a select dialog for user to select from results.

Optionally can add a tmdb_type=TYPE param to tailor the search for more relevant results

RunScript(plugin.video.themoviedb.helper,wikipedia=Alien,tmdb_type=movie)
RunScript(plugin.video.themoviedb.helper,wikipedia=Chernobyl,tmdb_type=tv)
RunScript(plugin.video.themoviedb.helper,wikipedia=Matt Smith,tmdb_type=person)
Clone this wiki locally