Difference between revisions of "Parameter System"

From TV-Browser Wiki
Jump to: navigation, search
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== What is the "Parameter System"? ==
 
== What is the "Parameter System"? ==
  
The Parameter System enables dynamic generated Text. This is used pass text-passages to create the EMails in the EMail-Plugin. In the Capture-Plugin it is used to pass the 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.
 +
 
 +
== 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 regular 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:
 +
{| border="1" cellspacing="0" cellpadding="3"
 +
!Input
 +
!Result
 +
|-
 +
|<nowiki>\\</nowiki>
 +
|<nowiki>\</nowiki>
 +
|-
 +
|<nowiki>\\\\</nowiki>
 +
|<nowiki>\\</nowiki>
 +
|-
 +
|<nowiki>\{</nowiki>
 +
|<nowiki>{</nowiki>
 +
|-
 +
|<nowiki>\}</nowiki>
 +
|<nowiki>}</nowiki>
 +
|-
 +
|}
 +
 
 +
[[de:Parametersystem]]
 +
 
 +
[[category:Usage]]

Latest revision as of 20:16, 28 September 2007

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 regular 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
\\ \
\\\\ \\
\{ {
\} }