Difference between revisions of "Parameter System"

From TV-Browser Wiki
Jump to: navigation, search
m (What is the "Parameter System"?: Übersetzung verbessert)
(Structure: Übersetzung überarbeitet, Schreibfehler korrigiert)
Line 3: Line 3:
 
The Parameter System enables dynamically generated texts. For example, this is used in the e-mail plugin to create the body text of an e-mail. In the Capture-Plugin it is used to pass parameters to 3rd party applications like WinTV.
 
The Parameter System enables dynamically generated texts. For example, this is used in the e-mail plugin to create the body text of an e-mail. In the Capture-Plugin it is used to pass parameters to 3rd party applications like WinTV.
  
== Assembly ==
+
== Structure ==
  
The assembly of the Parameter System is quite simple. All text which is embedded by { and } will represent variables or function results.
+
The structure of the Parameter System is fairly simple. Any text surrounded by { and } will be replaced by variables or function results.
  
For example the result of the following text will be:
+
For example, the result of the following text will be:
  The Title is {title}
+
  The title is {title}
  
when the name of the broadcast is "Hello, Spencer!"
+
when the title of the broadcast is "Coronation Street"
  The Title is Hello, Spencer!
+
  The title is Coronation Street!
  
 
You are also able to use functions to combine or split text.
 
You are also able to use functions to combine or split text.
Line 17: Line 17:
 
For example:
 
For example:
  
  The Title is {isset(original_title, title)}
+
  The title is {isset(original_title, title)}
in this case the original Title will be used, if this is not present the tilte of the broadcast is valid.
+
In this case, the original title will be used. If the original title is not available, the title of the broadcast will be shown.
  
Also interleaving of functions or possible:
+
Functions can also be nested:
  The Titel is {clean(isset(original_title, title))}
+
  The title is {clean(isset(original_title, title))}
  
Now all special characters will be replaced by underscores "_" .
+
Now, all special characters will be replaced by underscores "_".
  
You can also use your own "Parameter-Text-BLocks":
+
You can also define your own parameter texts:
  The original Title is {isset(original_title, "not present!")}
+
  The original title is {isset(original_title, "not available, so sorry!")}
  
Now the original title of the broadcast will be replaced by "not present" if it is not available
+
In this example the original title of the broadcast will be replaced by "not available, so sorry!" if the respective field is empty.
  The original Title is not present!
+
  The original title is not available, so sorry!
 
 
The complete List of parameters and functions are placed in each Plugin you use.
 
Why this? Because each Plugin can add functions and parameters.
 
  
 +
A complete list of parameters and functions is provided with each plug-in. Why is that? Because each plug-in can add its own functions and parameters.
  
 
== Special Characters ==
 
== Special Characters ==

Revision as of 19:19, 22 June 2006

What is the "Parameter System"?

The Parameter System enables dynamically generated texts. For example, this is used in the e-mail plugin to create the body text of an e-mail. In the Capture-Plugin it is used to pass parameters to 3rd party applications like WinTV.

Structure

The structure of the Parameter System is fairly simple. Any text surrounded by { and } will be replaced by variables or function results.

For example, the result of the following text will be:

The title is {title}

when the title of the broadcast is "Coronation Street"

The title is Coronation Street!

You are also able to use functions to combine or split text.

For example:

The title is {isset(original_title, title)}

In this case, the original title will be used. If the original title is not available, the title of the broadcast will be shown.

Functions can also be nested:

The title is {clean(isset(original_title, title))}

Now, all special characters will be replaced by underscores "_".

You can also define your own parameter texts:

The original title is {isset(original_title, "not available, so sorry!")}

In this example the original title of the broadcast will be replaced by "not available, so sorry!" if the respective field is empty.

The original title is not available, so sorry!

A complete list of parameters and functions is provided with each plug-in. Why is that? Because each plug-in can add its own functions and parameters.

Special Characters

If you want to use special characters like '\', '{' or '}' they have to be prefixed with a '\' (backslash).

This means:

Input Result
\\ \
\\\\ \\
\{ {
\} }