{"id":20838425,"url":"https://github.com/reload/os2display-slide-tools","last_synced_at":"2026-04-13T02:41:19.986Z","repository":{"id":47778878,"uuid":"165893420","full_name":"reload/os2display-slide-tools","owner":"reload","description":"Reusable tools for working with slides in https://github.com/os2display","archived":true,"fork":false,"pushed_at":"2021-08-13T08:49:23.000Z","size":85,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-04T22:23:07.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reload.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-15T17:24:22.000Z","updated_at":"2025-07-24T11:44:03.000Z","dependencies_parsed_at":"2022-09-11T01:22:29.461Z","dependency_job_id":null,"html_url":"https://github.com/reload/os2display-slide-tools","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/reload/os2display-slide-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fos2display-slide-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fos2display-slide-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fos2display-slide-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fos2display-slide-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reload","download_url":"https://codeload.github.com/reload/os2display-slide-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fos2display-slide-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31737849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"online","status_checked_at":"2026-04-13T02:00:06.623Z","response_time":93,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T01:10:14.094Z","updated_at":"2026-04-13T02:41:19.957Z","avatar_url":"https://github.com/reload.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Os2Display Slide Tools\n\nTools for working with slides for [https://github.com/os2display](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.\n\nThe 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.\n\n### Config variables\nThe variables here are the settings available on slides (in the `[slidename].json` file:\n\n| Variable name           |                                                              |\n| ----------------------- | ------------------------------------------------------------ |\n| `sis_total_items`       | How many data items should the slide have.                   |\n| `sis_items_pr_slide`    | How many data items should be displayed on each subslide.    |\n| `sis_subslide_duration` | How long should each subslide be displayed.                  |\n| `sis_cron_subscriber`   | Identifier to use if you want your slide type to fetch data on cron. |\n| `sis_data_ttl_minutes`   | How many minutes between data fetches for the slide type. Defaults to 10 minutes. |\n\nIn `config.yml` these settings are available:\n```yml\nos2_display_slide_tools:\n    use_ttl: true\n```\n`use_ttl` determines if there should be a wait between fetching data for the slides. It's set to `false` by default.\n\n## Creating a new slide type\n\nIn your [custom bundle](https://github.com/os2display/docs/blob/master/guidelines/custom-bundles-guidelines.md), create a new [template](https://github.com/os2display/docs/blob/master/guidelines/template-guidelines.md) following the documentation [here](https://github.com/os2display/docs/blob/master/guidelines/template-guidelines.md).\n\nTo take advantage of the tools in this repo you need to do a couple of things in your `.json` file:\n\n- In the `empty_options` part of the config, add the following defaults (with your own values of course).\n\n  ```json\n    \"empty_options\": {\n      \"sis_cron_subscriber\": \"your_cron_key\",\n      \"sis_subslide_duration\": 10,\n      \"sis_total_items\": 9,\n      \"sis_items_pr_slide\": 1,\n      \"sis_data_ttl_minutes\": 5\n    }\n  ```\n\n* If you want the user to be able to adjust these values, add the tool from this library in the `tools` part:\n\n```javascript\n    \"tools\": [   {\n        \"name\": \"Slides in slides\",\n        \"id\": \"slides-in-slide-config-editor\"\n      }\n    ]\n```\n\nThe `.js`-file you link to in `paths.js` in the `.json.` file can take advantage of the sub-slide-advancing in this tool.\n\nThe 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.\n\nYou can then use the subslide advancement something like this:\n\n```javascript\n// Register the function, if it does not already exist.\nif (!window.slideFunctions['my-template-id']) {\n  window.slideFunctions['my-template-id'] = {\n    /**\n     * Setup the slide for rendering.\n     * @param scope\n     *   The slide scope.\n     */\n    setup: function setupMyTemplate(scope) {\n      // Get subslides (that is the data items), num_subslides, and slide_duration\n      // and call the slides-in-slides tool with those values.\n      window.slidesInSlides.setup(scope, subslides, num_subslides, slide_duration);\n    },\n\n    /**\n     * Run the slide.\n     *\n     * @param slide\n     *   The slide.\n     * @param region\n     *   The region to call when the slide has been executed.\n     */\n    run: function runMyTemplate(slide, region) {\n      window.slidesInSlides.run(slide, region);\n    }\n  };\n}\n```\n\n## Fetching data on Cron\n\nCreate a service in your bundle that implements Symfony's `EventSubscriberInterface`. In the `getSubscribedEvents` function, use something like this:\n\n```javascript\n  public static function getSubscribedEvents()\n  {\n    return [\n      'os2displayslidetools.sis_cron.your_cron_key' =\u003e [\n        ['myFunctionToGetData'],\n      ]\n    ];\n  }\n```\n\n\n\nSee [this bundle](https://github.com/kkos2/os2display-admin) for some examples on how to use this tool with cron.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fos2display-slide-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freload%2Fos2display-slide-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fos2display-slide-tools/lists"}