I use a Responsive Framework like ZURB Foundation 3 on Drupal. This framework use specific CSS div container to make Videos like vimeo or youtube Responsive. http://foundation.zurb.com/docs/elements.php#vidCode

It will be nice to define globally the css class because i need not to define this on every content.


deggertsen’s picture

Version:7.x-3.1» 7.x-3.x-dev
Priority:Minor» Normal
Status:Active» Needs review
new1.38 KB

Here's a patch for this as I needed this as well so that I could define a max-width attribute for http://drupal.org/project/fitvids. Hope it helps!

Used to fix this issue as well #1874152: Video Filter with max-width

Chris Burge’s picture

Wrapping the iframe or object in a div seems common sense. I wrote an identical patch with only a different class name before finding this issue. Patch applies against 7.x-3.1. I don't see any risks with the patch.

Chris Burge’s picture

Issue summary:View changes
Status:Needs review» Reviewed & tested by the community
ramsalt’s picture

It would be a nice additional feature to add a code specific class to the wrapper. This way it is possible to style each wrapper a little differentlly.

Pere Orga’s picture

The patch has been RTBC for more than a year. Please can we have this merged?

DamienMcKenna’s picture

This should be added to the next release.

DamienMcKenna’s picture

Shouldn't the attribute be added to the standard field wrapper, rather than adding another DIV?

FYI this will probably need to be rerolled.

malcomio’s picture

Status:Reviewed & tested by the community» Needs review
new1.47 KB

Here's a re-rolled patch.

I don't think it makes sense to add attributes to the field wrapper, as this wouldn't be relevant to the case of video filter in body text.

malcomio’s picture

I'd also be inclined to include the relevant CSS in the module for responsive videos so that people who aren't using custom themes get the benefit as well.

Should be easy enough for people who do know CSS to override if needed.

Here's a patch that does that.

emmonsaz’s picture

FYI, I had better success with https://github.com/toddmotto/fluidvids

emmonsaz’s picture

new1.82 KB

Here's my patch draft. It could be improved with a fluidvids module using the Libraries API but for now it works for my needs...

pawel.traczynski’s picture

@emmonsaz - nice patch, but you should use hook_page_build instead of hook_init to add css or js.

emmonsaz’s picture

new1.83 KB

@pawel.traczynski Nice catch - thanks!