{"id":20961802,"url":"https://github.com/heimrichhannot/contao-youtube-bundle","last_synced_at":"2025-07-12T20:08:02.306Z","repository":{"id":57116831,"uuid":"127869168","full_name":"heimrichhannot/contao-youtube-bundle","owner":"heimrichhannot","description":"YouTube bundle aims responsive youtube videos with preview images and better privacy control. It provides support for content elements and news items.","archived":false,"fork":false,"pushed_at":"2025-03-10T15:43:40.000Z","size":449,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-19T12:32:26.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heimrichhannot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-04-03T07:32:40.000Z","updated_at":"2025-03-10T15:43:39.000Z","dependencies_parsed_at":"2024-02-12T13:47:24.617Z","dependency_job_id":null,"html_url":"https://github.com/heimrichhannot/contao-youtube-bundle","commit_stats":{"total_commits":82,"total_committers":10,"mean_commits":8.2,"dds":0.7195121951219512,"last_synced_commit":"cd6861a5a57eb0be1cafcf171554375b0c48b09c"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-youtube-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-youtube-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-youtube-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-youtube-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimrichhannot","download_url":"https://codeload.github.com/heimrichhannot/contao-youtube-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254094854,"owners_count":22013649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-19T02:17:35.068Z","updated_at":"2025-05-14T07:31:02.223Z","avatar_url":"https://github.com/heimrichhannot.png","language":"PHP","readme":"# YouTube\n\n[![](https://img.shields.io/packagist/v/heimrichhannot/contao-youtube-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-youtube-bundle)\n[![](https://img.shields.io/packagist/dt/heimrichhannot/contao-youtube-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-youtube-bundle)\n[![Build Status](https://travis-ci.org/heimrichhannot/contao-youtube-bundle.svg?branch=master)](https://travis-ci.org/heimrichhannot/contao-youtube-bundle)\n[![Coverage Status](https://coveralls.io/repos/github/heimrichhannot/contao-youtube-bundle/badge.svg?branch=master)](https://coveralls.io/github/heimrichhannot/contao-youtube-bundle?branch=master)\n\n\u003e YouTube-Bundle is not actively maintained anymore, as we developed a successor bundle: [Video Bundle](https://github.com/heimrichhannot/contao-video-bundle).\n\nYouTube bundle aims responsive youtube videos with preview images and better privacy control.\nIt provides support for content elements and news items.\n\n**An valid [Youtube Data API Key](https://developers.google.com/youtube/v3/getting-started) is required for automatic preview image support (enter on in contao system settings or on your root page).** \n\n\u003e If you upgrade from heimrichhannot/contao-youtube, see the [upgrade notices](#upgrade-notice-from-heimrichhannotcontao-youtube).\n\n## Features\n \n* Responsive youtube videos\n* Preview image for youtube videos\n    * If no custom image is given, the preview image will be loaded from youtube and saved under 'files/media/youtube/' \n* ConfigElements for [List-](https://github.com/heimrichhannot/contao-list-bundle) and [Readerbundle](https://github.com/heimrichhannot/contao-reader-bundle).\n* [Encore Bundle](https://github.com/heimrichhannot/contao-encore-bundle) support\n* Privacy mode \n    * In privacy mode the video is displayed, after the user accepted a privacy advice within a modal prompt\n    * The user can mark his selection as permanent with a checkbox (state will be saved in a cookie)\n\n![alt privacy modal](./docs/img/privacy_modal.jpg)\n\n## Technical instruction\n\n### Add to list and reader item templates\n\nFor usage with [List-](https://github.com/heimrichhannot/contao-list-bundle) and [Readerbundle](https://github.com/heimrichhannot/contao-reader-bundle) you first need to add the config elements in List- and/or Reader config.\n\nAfterwards you can add youtube to your template. The config elements add a formatted value `youtubeVideos` containing an array for each youtube field add by an config element.\n\n```php\n$templateData = [\n    // ...\n    'youtubeVideos' =\u003e [\n        'youtubeField' =\u003e [ // The selected youtube field name from config element\n            'video' =\u003e '' // Generated default template,\n            'data' =\u003e [] // Video data for custom templates\n        ]\n    ]\n]\n``` \n\nExample custom template:\n```yaml\n\n{% if raw.addYouTube == \"1\" and youtubeVideos.youtube|default%}\n    {% include '@VendorMyBundle/youtube/youtube_video_custom.html.twig' with youtubeVideos.youtube.data %}\n{% endif %}\n```\n\n### News template\n\nYoutube videos can be added to news templates with ease. Just add the following code (for example: news_full.html5):\n\n```\n\u003c?php if($this-\u003eyoutube \u0026\u0026 $this-\u003eyoutube-\u003evideo): ?\u003e\n\t\u003c?= $this-\u003eyoutube-\u003evideo; ?\u003e\n\u003c?php endif; ?\u003e\n```\n\n### Preview images from YouTube\n\nTo use preview images from youtube, you have to generate an API key (https://developers.google.com/youtube/v3/getting-started) and place it in the contao settings.\n\n### Commands\n\n#### Migration Command\n\n```\nUsage:\n  huh:youtube:migration [options]\n\nOptions:\n      --dry-run              Performs a run without writing to database.\n      --migration=MIGRATION  Do migration directly without interrupt. Options: module, database, both, none\n  -h, --help                 Display this help message\n  -q, --quiet                Do not output any message\n  -V, --version              Display this application version\n      --ansi                 Force ANSI output\n      --no-ansi              Disable ANSI output\n  -n, --no-interaction       Do not ask any interactive question\n  -e, --env=ENV              The Environment name. [default: \"prod\"]\n      --no-debug             Switches off debug mode.\n  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  This command provide migration scripts to migrate from heimrichhannot/contao-youtube to heimrichhannot/contao-youtube-bundle.\n  \n  Available migrations:\n    'module' updates default template names and field values\n    'database' updates database fields that can't be updated by the contao install tool.\n    'both' will run 'module' and 'database' migrations.\n```\n\n\n## Developers\n\n### Events\n\nEvent | Event ID\n----- | ---------\nEvent to interact with AlertifyJs 'onshow' event | `huh.youtube.event.alertify.onshow`\nEvent to interact with AlertifyJs 'onfocus' event | `huh.youtube.event.alertify.onfocus`\n\n## Upgrade notice from heimrichhannot/contao-youtube\n\n- Use `huh:youtube:migration` command to migrated the default template settings in root pages and relatedYoutubeNews database field\n- Declare an Youtube-API Key in tl_settings or tl_page (otherwise preview image download wont work)\n- The modal windows for privacy dialog or modalvideo require additional css, that is not delivered by the bundle. Markup fits [Bootstrap](http://getbootstrap.com/) modal window css, so you are well-advised to use the css from that framework.\n- If you were using custom youtube `.html5` templates, migrate them to `.html.twig` templates, if you need help: check the default templates\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-youtube-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimrichhannot%2Fcontao-youtube-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-youtube-bundle/lists"}