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

Comments

Projects
None yet
2 participants
@zonky2
Copy link

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 modified the milestones: 2.1.0, 1.0.x Jun 5, 2019

@dmolineus dmolineus closed this Jun 5, 2019

@dmolineus dmolineus reopened this Jun 5, 2019

@dmolineus

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

There should be probably different templates for each ratio

@dmolineus dmolineus modified the milestones: 1.0.x, 2.1.0 Jun 5, 2019

@zonky2

This comment has been minimized.

Copy link
Author

commented Jun 5, 2019

There should be probably different templates for each ratio

I find rather inflexible...

@dmolineus

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

What do you suggest?

@zonky2

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.