Seitenhierarchie

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.32
            Releasenews | Download
 MediaPortal 2.5
            Releasenews | Download


Purpose

  • Required:  No
  • Type of Change:  Feature

The patch adds a new property (hyperlinkParameter) to GUIButtonControl. This property will be passed to the plugin that is opened with the hyperlink property. The plugin can then open a specific view/site/part of the plugin, depending on the parameter.

How this new feature is used is up to the plugin/skin developers but here are some scenarios with a few of the most popular plugins:

MovingPictures

The BasicHome screen contains two hyperlinks to MovingPictures with two different hyperlinkParameters

  • Link 1 is named "Kids Movies" and will open MovingPictures with the category defined for save usage by the children
  • Link2 is named "Movies" and will open MovingPictures and show all movies (it may be secured with a pin)

MP-TVSeries

The BasicHome of skin x contains two links to mp-tvseries each with a different hyperlinkParameter

  • Link 1 will open mp-tvseries and show Bobs Favorite series
  • Link2 will open Janes favorite series
  • Link3 will show all shows for the kids

OnlineVideos

BasicHome will have own icons for OnlineVideos->Youtube and OnlineVideos->GameTrailers.

Other Plugins

  • MyTrailers can be called from other plugins with an imdb id as parameter, MyTrailers will show trailer for this specific movie
  • Weather plugin could be called for different cities

Description of Change

The button control (GuiButtonControl) and each control that derivates from button has a new attribute "hyperlinkparameter". If this attribute is set, the containing string will be passed to the plugin when its loaded. If the plugin recognises the string format, it can start in a specific manner (e.g. show a specific item/view/...)

[XMLSkinElement("hyperlinkParameter")] protected string _hyperLinkParameter = "";

How the plugin handles this string is completely up to the plugin developer. The might use a single string, they could also use seperators to allow multiple parameters (e.g. parameter1|parameter2|...|parameterX). It is then up to the skin designer to decide if they want to support this new feature by defining these parameters in their skins or by allowing their users to edit the parameters (e.g. with a BasicHome editor).

Details

More information on how to use parameterized startup can be found on the following locations:

Additional Information and References

XML/Code Samples

The following shows a button that opens the plugin MovingPictures (window id 96742) with the name of a specific category (${UnwatchedMovies}), which will be shown directly when the plugin is opened.

<control>
    <type>button</type>
    <hyperlink>96742</hyperlink>
    <hyperlinkParameter>UnwatchedMovies</hyperlinkParameter>
</control>

 

With the following code sample, the plugin can then check for the variable (e.g. when starting the plugin)

protected override void OnPageLoad() {   

             ....            

             if (_loadParameter != null)
                {
                  List<DBNode<DBMovieInfo>> categories = browser.CategoriesMenu.RootNodes;
                  foreach (DBNode<DBMovieInfo> i in categories )
                  {
                    if (i.Name.Equals(_loadParameter))
                    {
                      browser.CurrentNode = i;
                      break;
                    }
                  }
                }

            ....

        }

Screenshots

   

 

This page has no comments.