Difference between revisions of "Parameter System"
m (→What is the "Parameter System"?: Übersetzung verbessert) |
Bananeweizen (talk | contribs) |
||
(2 intermediate revisions by one other user not shown) | |||
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. | ||
− | == | + | == Structure == |
− | The | + | 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 | + | The title is {title} |
− | when the | + | when the title of the broadcast is "Coronation Street" |
− | The | + | 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 | + | 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 | + | 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 | + | You can also define your own parameter texts: |
− | The original | + | 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 | + | 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 == | == Special Characters == | ||
Line 58: | Line 56: | ||
[[de:Parametersystem]] | [[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 |
---|---|
\\ | \ |
\\\\ | \\ |
\{ | { |
\} | } |