Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new template for responsive YT video #21

Closed
zonky2 opened this issue May 31, 2019 · 7 comments
Closed

new template for responsive YT video #21

zonky2 opened this issue May 31, 2019 · 7 comments
Assignees
Milestone

Comments

@zonky2
Copy link

@zonky2 zonky2 commented May 31, 2019

new template

<?php $this->extend('block_unsearchable'); ?>

<?php $this->block('content'); ?>
-    <iframe <?= $this->size ?> src="<?= $this->src ?>" allowfullscreen></iframe>
+  <div class="embed-responsive embed-responsive-16by9">
+    <iframe class="embed-responsive-item"<?= $this->size ?> src="<?= $this->src ?>" allowfullscreen></iframe>
+  </div>

<?php $this->endblock(); ?>

The class embed-responsive-16by9 should be passed from the outer div with ce_youtube to the iframe-enclosing div

@dmolineus dmolineus self-assigned this Jun 5, 2019
@dmolineus dmolineus added this to the 2.1.0 milestone Jun 5, 2019
@dmolineus dmolineus removed this from the 2.1.0 milestone Jun 5, 2019
@dmolineus dmolineus added this to the 1.0.x milestone Jun 5, 2019
@dmolineus dmolineus closed this Jun 5, 2019
@dmolineus dmolineus reopened this Jun 5, 2019
@dmolineus
Copy link
Member

@dmolineus dmolineus commented Jun 5, 2019

There should be probably different templates for each ratio

@dmolineus dmolineus removed this from the 1.0.x milestone Jun 5, 2019
@dmolineus dmolineus added this to the 2.1.0 milestone Jun 5, 2019
@zonky2
Copy link
Author

@zonky2 zonky2 commented Jun 5, 2019

There should be probably different templates for each ratio

I find rather inflexible...

@dmolineus
Copy link
Member

@dmolineus dmolineus commented Jun 5, 2019

What do you suggest?

@zonky2
Copy link
Author

@zonky2 zonky2 commented Jun 5, 2019

we can use the same "magic function" like "img-fluid" to transfer the css class to the right div container...

Edit: we can use the class "embed-responsive-16by9" as default and override this with magic function

16:9 is the standard https://support.google.com/youtube/answer/6375112?co=GENIE.Platform%3DDesktop&hl=de

@dmolineus
Copy link
Member

@dmolineus dmolineus commented Jun 13, 2019

Since contao/core-bundle@0d0aba2#diff-800975046c3ea232e3dd2a377584899b Contao provides an aspect setting. I prefer using it with a customized template. Only drawback is, that's not available in Contao 4.4.

@zonky2
Copy link
Author

@zonky2 zonky2 commented Jun 13, 2019

o.k. - maybe we can use "embed-responsive-16by9" as default and everybody can override this template (and css class)

@dmolineus
Copy link
Member

@dmolineus dmolineus commented Jun 13, 2019

I decided to backport the playerAspect setting so it's available in Contao 4.4 as well, see a861b1c

@dmolineus dmolineus closed this Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants