Difference between revisions of "Parameter System"

From TV-Browser Wiki
Jump to: navigation, search
(Assembly)
 
(5 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.
  
== 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 regular 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 ==
Line 39: Line 37:
  
 
This means:
 
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
\\ \
\\\\ \\
\{ {
\} }