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.
Hello,
According to you what would be the best way to transform the left/content/right layout into Content/left/right while keeping the flexibility of removing left or right or both ?
Here what I've done but I don't think it is ideal :
In Layout.css
#content {
float:left;
width:100%;
margin-right:-100%;
padding:0;
}
.sidebar {
float:right;
}
.two-sidebars #content-inner {
margin-right: 350px; /* Right Sidebar width + Left Sidebar width */
}
.sidebar-right #content-inner {
margin-right: 200px; /* Right Sidebar width */
}
.sidebar-left #content-inner {
margin-right: 150px; /* Left Sidebar width */
}
#sidebar-left {
width: 150px;
}
#sidebar-right{
width: 200px;
}
The bad thing: In page.tpl.php I had to put $right before $left so that I have left on the left of right ;-)
And congratulations for this theme.
Alex.
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedYour solution is pretty good, and I think it's simple enough, you could just rename left right and right left and it would work. It is not a bad thing to change the page template :)
Here is another solution that would avoid changing the page template, and have the sidebar in the right order. I didn't test it on IE though, but it should be ok. You will have to set the width values of the content to make sure it isn't squished when they're is no content to display though.
You technic makes the content float on the left and the sidebars float on the right, this one make everything floats on the left, and uses negative margins to bring the sidebars where you want them :
Notice that I set a default value for the sidebar and then overide it only for the right one, you could also do this with your code to make it even simpler.
Hope this helps
N.B: What is kinda cool here is that it works even on fluid width! Again, I didn't test it much, but it's promissing.
Comment #2
ineation CreditAttribution: ineation commentedYes, I've rougly tested both solutions in Firefox 3, Chrome and IE 6 (virtual).
It works fine.
My css is simpler but the markup is not logical.
Your CSS is a little more complex (negative margins) but the layout is independent of the markup order. Which is why I think your solution is better.
Both solutions work with a fluid width (with weird things happening at small widths with chrome), which indeed is excellent.
I don't know what is your policy regarding this theme. But it may be a good idea to put an alternative layout such as layoutCLR.css so that by just changing the .info you may be able to switch from a LCR layout to a CLR layout.
On the other hand maybe you prefer to keep it focused on one layout and simplicity.
Either way, thank you for your help...
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedWe are very concerned about the simplicity of the theme, and try to keep the amount of file as low as possible. Adding more layout option is a good idea, but we are still thinking about the best way to do this.
We first need more documentation, and this is priority :)
At least this issue is here to help people who will have the same problem as you.
Thanks
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #6
Sinan Erdem CreditAttribution: Sinan Erdem commentedThanks, I was looking for a solution. And it works perfect for me...
Since "Basic" is a nice starter theme, maybe this code could be included as commented in the original layout.css just to offer a choice.
Comment #7
Sinan Erdem CreditAttribution: Sinan Erdem commentedAfter some tests, the second method doesnt work for me on IE6. Layout breaks. I think it is about negative margins. Does anyone have an idea?
Actually I would like to use the second method because if the content is larger than the content area width, then it pushes the sidebars to the right. But in the first method, sidebars place over the content.
Here is my code in the layout.css: