Hi,

Can you add the possibility to put width in % or another unit instead of only px for frame sizes ?

px are not funny to style...

Thanks a lot :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

devil2005 created an issue. See original summary.

mukeshMukesh12’s picture

It is possible to make Embeded Iframes responsive.(give width to iframes in % with css)
please refer this link:- http://embedresponsively.com/ (See result click on Embed button).

but in many modules the Iframe Structure is not like embed iframes i.e youtube,vimeo.

in modules iframe structure inside body tags there are only divs where as in embed iframes there is object tag which allow the css to over-ride iframe css (allow to set width in % with css)

Some how if we introduce this object tag in modules iframes then it become easy to set there width in % with css.

neffets’s picture

I experimented with "object" tag too, but there were IE issues
see static page: http://www.neffets.de/sites/static/object4iframe.html
Feedback welcome.

In newer browsers there were issues relating object-with-url-from-foreign-site security-violation warnings/errors.

mukeshMukesh12’s picture

@neffets Sorry I'dont have IE7 and IE8 browser in my system and recommended please not to give priority to these browsers as they are outdated.
as I go through this link http://www.neffets.de/sites/static/object4iframe.html. the iframes are not looking so good.

please try this
first of all wrap each object tag into a wrapper say object-wrapper.
and link this style to this
.object-wrapper {
width: 100%;
height: auto;
position: relative;
padding-bottom: 56.25%;
}
.object-wrapper object {
width: 100% !important;
height: 100% !important;
position: absolute !important;
top: 0 !important;
left: 0 !important;
}

I think surely this will work please try

neffets’s picture

object-wrapper added:

Variant A: without bottom padding, height auto seems to be calculated to 0

Variant B: padding-bottom 56%
is here to much, its not dynamic, its fix from window of parent-page, not of the object-iframe

osopolar’s picture

Maybe the FitVids module could be helpful for this issue.

neffets’s picture

Version 8.1.6 supports heigth/width with "%" values

tec: #^(\d+|\d+[%]|auto)$#

frederickjh’s picture

Version: 8.x-1.5 » 8.x-1.7
Component: Miscellaneous » Documentation
Category: Feature request » Task
FileSize
16.92 KB

@neffets
Changing this to a Documentation task and bumping the version as the feature now exists but the documentation and UI still refer to the fixed numbers.

From 8.x-1.7 README.txt

Field Settings
1. Navigate to Administration > Structure > Content types > [Content to edit] > Manage fields > Field to edit > Field Settings.
2. The width and height of an Iframe can be added. They require fixed width and only numbers are allowed.
3. . . .

User interface:

frederickjh’s picture

The use of percentages is documented on the project page.

frederickjh’s picture

Patch updating the README.txt and the UI.

osopolar’s picture

The use of percentage for width was introduced in #2748283: Width and Height fields are required all the time. Would be nice if back-ported to drupal 7.

  • 43e3614 committed on 8.x-1.x
    Issue #2822197 by frederickjh, devil2005: width of frame - extended...
neffets’s picture

Assigned: Unassigned » neffets
Status: Active » Fixed

Added documentation.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.