Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to strech the content to 100% of the page width, when there's nothing on the sidebar?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 960 Views
  • John Doe
    Avatar
    Community Member
    1 Post

    How to strech the content to 100% of the page width, when there's nothing on the sidebar? Link to this post

    Hi everyone,

    I have just set up a new site and find it quite annoying that the main content takes up only about 2/3 of the whole width, even when I have nothing in the sidebar.

    Anyone knows how to solve this problem? TIA!

    You might have a look at my site at www.giit-trans.com, thank you!

  • UncleCheese
    Avatar
    4085 Posts

    Re: How to strech the content to 100% of the page width, when there's nothing on the sidebar? Link to this post

    I think it looks good. It would be awkward to remove the sidebar all of a sudden just because there's no content. And 100% width for that content will get awfully hard to read. That's at least true in the Roman alphabet. Maybe not for you if you're reading top to bottom?

    Anyway, one way to do it would be this:

    <% if SidebarContent %>
    <div id="sidebar">content here</div>
    <% end_if %>

    Then you'd have to write a function in your controller to determine whether SidebarContent reutrns true or false.

    But again, I don't see a need to do that. I think it would look awkward.

    960 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.