@FILE file_path

Binds the variable to a file, where file_path is the path and name of the file. The return value is a string containing the content of the file. The file path is the absolute path from the root of the server or your particular installation.

The @FILE command is very useful in cases where we might want to generate data that's available in file. By using the || and == characters as a delimiter we could interface with any external database application.

For example: Let's say we have a text file called headline_news.txt that is external to our database system. This file is constantly being updated with up-to-the-minute news items by another external system. We want to display these news items on our website for our visitors to see. How can we do that?

First, we might create a new Template Variable and set the display Widget to Ticker.

We then add the @FILE command inside the default value of the TV. This will point to where the headline_news.txt is located in our example.

Each headline in the headline_news.txt file is separated by a new-line (lf or \n) character. We can use the Delimiter property of the Ticker to separate each item and display them one at a time. We'll also change the background color of the ticker using the Style property.

Note: The \n character is used to represent the new line character

Suggest an edit to this page.