Embedded Video: Width of Form overshoots its container

thepiano - October 23, 2009 - 17:11
Project:Embedded Media Field
Version:6.x-1.12
Component:Embedded Video Field
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Module Versions

  1. Drupal Core 6.14
  2. CCK 6.x-3.x-dev
  3. Emfield 6.x-1.12

Problem occurs when we try to add a content type with the Embedded Videos field. If drupal_render($form['videos_fieldname']) is printed inside a container of width, say, 500px; the Embedded Videos form actually is rendered more than the parent's width. This occurs on FF, Safari, and Opera. I didn't test on IE and Chrome yet.

Moreover, the "Remove this item" icon at the top right hand corner is not visible in Opera.

Anyone knows what is going on?

Thank You.

#1

aaron - October 28, 2009 - 17:56
Status:active» postponed (maintainer needs more info)

not sure; i don't use the form formatter often. have you tried using the formatter that displays the form element? also, you can probably modify the css to render it properly.

#2

thepiano - October 29, 2009 - 03:37

In my template.php, I have this

<?php
function mycustomtheme_theme($existing, $type, $theme, $path)
{
    return array(
   
'mycustom_node_form_id' => array(
         
'arguments' => array('form' => NULL),
         
'template' => 'mycustom_node_form_id', // this is the name of the template
       
)
    );
}
?>

and in mycustom_node_form_id.tpl.php, I have this

<div style="width:762px;">
  <?php print drupal_render($form['field_my_videos']); ?>
</div>

<?php print drupal_render($form); ?>

I'm trying to put the embedded videos form in a container of some size. I understand this is how we custom theme a form layout. We specify the template to use in template.php, and do drupal_render(some_form_element) according to the layout we want, and do a final drupal_render($form) for the rest of the hidden elements (if we missed any).

I also inspected the html structure, and the css properties of the videos form using Firebug. There's one table which is hidden, and its width set to some 768.75px (inline style). And the next table which follows right after that contains all the rows of embedded videos. There is no html element inside that table which has a width property set. This is the part that is really puzzling. Since there is no width set for any html element there, shouldn't the whole table observe the width set by its parent container?

AttachmentSize
Untitled-1.jpg 87.55 KB
 
 

Drupal is a registered trademark of Dries Buytaert.