Is it possible in some way to have full width fields inside non-full-width regions?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ANDiTKO’s picture

Γεια σου Γιάννη,

Have you tried to add width 100% to your field like this?

div.region-myregion div.myfield {
  width: 100%;
}

Note that if its an inline element like <a>, <span>, <input> etc you need to make it display like a block. Else the width:100% won't work. Try:

div.region-myregion div.myfield a {
  display: block;
  width: 100%;
}

The Fences module can help you control how your fields are rendered.

Can you be more specific and give an example of what you are trying to achieve?

marcoka’s picture

Γεια σου Γιάννη <- what does this mean.

you want a field to be as wide as the viewport and the region only to be as it is? normally i fields maximum width can be the regions width. otherwise you need to do some tricks with position.

yannisc’s picture

Finally achieved what I wanted by setting the enclosed div to have negative margins (margin:0 -2500px;). You can see the final result here. The comments section expands to full width: http://www.netstudio.gr/en/blog/migrating-ivf-embryogr-joomla-drupal

marcoka’s picture

Status: Active » Fixed
ANDiTKO’s picture

Well i don't think that adding big negative margin is the best solution. You are adding horizontal scrollbar that breaks your layout when the comment div is rendered. See my screenshot. Also "blackhatseo people" trend to use negative margins to hide keywords. You must avoid making your child element wider than its parent.

Here is a better solution:

You must render the comments outside the content zone. This is pretty easy and i did it in few minutes. Here is how:

1) Download and install the Commentsblock module. (this will render the comments in a block)
2) Visit the module configuration page and select NO in the Display comment form only? selectbox.
3) Add a new zone to your theme. Right after the content zone. Configure it to have one full width region.
4) Add the commentsblock block to your comment zone region.
5) Style it

Here is a screenshot of my Omega theme rendering the comments outside the content zone.

yannisc’s picture

ANDiTKO this is a smart solution! thanks!

marcoka’s picture

hrhr, nice. as i wrote the commentsblock module :). fyi, it has a permission "view comments" bug, but a fix is in the issue queue there. havent had time to push a new release yet.

Status: Fixed » Closed (fixed)

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