Skip to content

How to add options to the URL

Jeffrey Gilliam edited this page Jul 22, 2016 · 1 revision

Many of the Apps/Widgets allow you to customize their behavior simply by setting an option in the URL. But, the documentation may only describe the option assuming you are building an app from HTML. If the parameter starts with "data-sra-args-", follow these instructions to set it from the URL.

Suppose the documentation says this:

data-sra-args-show-digital-value {boolean} Set to true or false for displaying the digital value. Defaults to true.
data-sra-args-interval {integer} The interval, in milliseconds, that this widget will update from the server. Default is 16.

What you want to do is remove the prefix "data-sra-args-" and remove the hyphens, so that all that remains is the text. Then add it to the URL as a parameter. You can optionally convert it to uppercase as well. Each parameter should start with an ampersand(&), unless it is the very first parameter which must start with a question mark(?).

From:
http://{YOUR.IP.ADDRESS}/SIMRacingApps/Apps/WidgetLoader?widget=AnalogGauge/Spek/Tachometer
To:
http://{YOUR.IP.ADDRESS}/SIMRacingApps/Apps/WidgetLoader?widget=AnalogGauge/Spek/Tachometer&showdigitalvalue=false
http://{YOUR.IP.ADDRESS}/SIMRacingApps/Apps/WidgetLoader?widget=AnalogGauge/Spek/Tachometer&showdigitalvalue=false&interval=32

Global options that are supported by all Apps and Widgets

  1. backgroundcolor={CSS color statement} Default is set by the widget
  2. color={CSS color statement} Default=white
  3. interface={HTTP | WEBSOCKET | STREAMING | WEBEVENT} Default=WEBSOCKET
  4. interval={milliseconds} Default is set by widget
  5. lang={LanguageCode | LanguageCode_CountryCode} Default is set by the browser
  6. showFPS={true | false} Default=false