Differences
This shows you the differences between two versions of the page.
— |
blocks:app-note:csvfeed [2021-05-02 20:24] (current) admin created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Rendering a local CSV file data using a Feed ====== | ||
+ | This application note shows how you can use a table loaded from a CSV file as a dynamic data source rendered by Blocks. Such a CSV (comma separated values) file can be exported from an Excel or most other spreadsheet applications. The data in this example lists a number of visitors during the day, with name, company and city. Each visitor also have an expected arrival and departure time. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ==== Installation and Usage ==== | ||
+ | |||
+ | You need a computer with a running blocks server and a web browser to run this application note. Here's the {{ : | ||
+ | |||
+ | - Start Blocks. | ||
+ | - Open the Blocks editor using the Admin button. | ||
+ | - Log in using the proper credentials (default user name is //admin// and the password is //pixi//). | ||
+ | - Open a second browser window to the same address as the editor window, but replace /edit/xxx with /spot to act as a simulated Display Spot. | ||
+ | - Back in the Blocks editor, double-click the display spot named Lobby. | ||
+ | - Assign this display spot to the ID shown in the second browser window and click OK. | ||
+ | - The list of visitors should appear in the simulated Display Spot browser window. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | There are two blocks in this application note. The " | ||
+ | |||
+ | |||
+ | ===== Behind the Scenes ===== | ||
+ | |||
+ | The source data is found in the file script/ | ||
+ | |||
+ | The Visitor1 block just renders all the entries provided by the feed script as a list using a Scroller. The Scroller is placed in a Slideshow, alternating between the visitor list and a logotype. This causes the list to be reloaded once every cycle. | ||
+ | |||
+ | The Visitor2 block is similar, but also renders a blue dot based on additional data provided by its corresponding feed script, and shows a "No visits scheduled" | ||
+ | |||
+ | The feed scripts manage the connection from Blocks to any data source (here the local CSV file). [[blocks: |