Download the PHP package reload/os2display-slide-tools without Composer
On this page you can find all versions of the php package reload/os2display-slide-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download reload/os2display-slide-tools
More information about reload/os2display-slide-tools
Files in reload/os2display-slide-tools
Package os2display-slide-tools
Short Description Reusable tools for working with slides in https://github.com/os2display
License
Informations about the package os2display-slide-tools
Os2Display Slide Tools
Tools for working with slides for https://github.com/os2display The tools are meant to help with slides that have "slides within". It is not meant to replace the slide advancer in Os2Display, but it can allow a slide setup once by a person to have as many sub-slides as needed.
The idea is that a slide will have a number of "data items". That could be a list of events for instance. Each event would be a data item. The slide can have any number of subslides that displays a number of data items.
Config variables
The variables here are the settings available on slides (in the [slidename].json
file:
Variable name | |
---|---|
sis_total_items |
How many data items should the slide have. |
sis_items_pr_slide |
How many data items should be displayed on each subslide. |
sis_subslide_duration |
How long should each subslide be displayed. |
sis_cron_subscriber |
Identifier to use if you want your slide type to fetch data on cron. |
sis_data_ttl_minutes |
How many minutes between data fetches for the slide type. Defaults to 10 minutes. |
In config.yml
these settings are available:
use_ttl
determines if there should be a wait between fetching data for the slides. It's set to false
by default.
Creating a new slide type
In your custom bundle, create a new template following the documentation here.
To take advantage of the tools in this repo you need to do a couple of things in your .json
file:
-
In the
empty_options
part of the config, add the following defaults (with your own values of course). - If you want the user to be able to adjust these values, add the tool from this library in the
tools
part:
The .js
-file you link to in paths.js
in the .json.
file can take advantage of the sub-slide-advancing in this tool.
The Os2Display framework does not have a way to include more than one JS file for each slide, so you will have to use Gulp or whatever your tool of choice is to compile Resources/public/js/slides-in-slide.js
from this library into your .js
file for the slide.
You can then use the subslide advancement something like this:
Fetching data on Cron
Create a service in your bundle that implements Symfony's EventSubscriberInterface
. In the getSubscribedEvents
function, use something like this:
See this bundle for some examples on how to use this tool with cron.