Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible in some way to have full width fields inside non-full-width regions?
Comment | File | Size | Author |
---|---|---|---|
#5 | scrollbar-nodeid1624462.png | 42.02 KB | ANDiTKO |
#5 | comment-block-nodeid1624462.png | 79.96 KB | ANDiTKO |
Comments
Comment #1
ANDiTKO CreditAttribution: ANDiTKO commentedΓεια σου Γιάννη,
Have you tried to add width 100% to your field like this?
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: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?
Comment #2
marcoka CreditAttribution: marcoka commentedΓεια σου Γιάννη <- 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.
Comment #3
yannisc CreditAttribution: yannisc commentedFinally 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
Comment #4
marcoka CreditAttribution: marcoka commentedComment #5
ANDiTKO CreditAttribution: ANDiTKO commentedWell 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.
Comment #6
yannisc CreditAttribution: yannisc commentedANDiTKO this is a smart solution! thanks!
Comment #7
marcoka CreditAttribution: marcoka commentedhrhr, 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.