You are here

simplifying-training.html.twig in Simplifying 8

{% 
  set src = {
    'uk': 'https://www.youtube.com/embed/jlOIdjX0KnQ',
    'ru': 'https://www.youtube.com/embed/bvyZ8-vElD4',
    'en': 'https://www.youtube.com/embed/xZ8pHbxwCGQ',
  }
%}
<div class="video-wrapper" style="max-width: 1170px; margin: 0 auto; outline: 1px solid #ccc;">
  <div class="video-container" style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
    <iframe style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="{% if src[ data.langcode ] %}{{ src[ data.langcode ] }}{% else %}{{ src.en }}{% endif %}" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  </div>
</div>

File

templates/simplifying-training.html.twig
View source
  1. {%
  2. set src = {
  3. 'uk': 'https://www.youtube.com/embed/jlOIdjX0KnQ',
  4. 'ru': 'https://www.youtube.com/embed/bvyZ8-vElD4',
  5. 'en': 'https://www.youtube.com/embed/xZ8pHbxwCGQ',
  6. }
  7. %}
  8. <div class="video-wrapper" style="max-width: 1170px; margin: 0 auto; outline: 1px solid #ccc;">
  9. <div class="video-container" style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
  10. <iframe style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="{% if src[ data.langcode ] %}{{ src[ data.langcode ] }}{% else %}{{ src.en }}{% endif %}" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  11. </div>
  12. </div>