Jump to:

23355 Posts in 17734 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Weird Sidebar Issue

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 887 Views
  • TerryMiddleton
    Avatar
    Community Member
    108 Posts

    Weird Sidebar Issue Link to this post

    I have a site that has a max of 3 menu levels

    In my sidebar.ss I have the following code which does not work. I"m pulling my hair. I've had my sidebar working perfectly even showing the 3 menu levels and something happened. I did a dev/build and now it's all tweaked.

    Here's the weird part. When I click on any menu(1) item the submenu does not show up, but it shows up for another menu(1) item above it.

    <ul id="menu">
       <% control Menu(1) %> <!-- Level I -->
        <li class="m$ID"><a href="$Link" target="_self" class="a$ID">$MenuTitle.XML</a>   
             <% if LinkOrCurrent = current %>
                <% control Children %>
                   <ul id="smenu">
                       <li class="sm$ID"><a href="$Link" title="Go to the $Title.XML page" class="sa$ID">$MenuTitle</a></li>
                   </ul>
                <% end_control %>    
                <% end_if %>   
       </li>            
       <% end_control %>
    </ul>

    Can you help. This is really strange and I'm going crazy.

    Thanks,

    Terry

  • TerryMiddleton
    Avatar
    Community Member
    108 Posts

    Re: Weird Sidebar Issue Link to this post

    Okay, I figured it out. Talked about having your *rear* handed to you by a computer. Oh man! What a weekend.

    Here's the big deal. You have to close the <li> with a </li> before you go off and start another <ul> or the children.

    Maybe I should take computer 101 again in school. I got smacked down. But it now works like a charm and I can get on with life.

    Terry

  • briensmith
    Avatar
    Community Member
    1 Post

    Re: Weird Sidebar Issue Link to this post

    The CSS is: http:// w ww.stolen-bikes.org/css/non_ie.css

    Basically I want the sidebar (blue div), to line up on the side as it is but up flush against the top as you would expect a floated content area with a floated sidebar next to it. If I take out the #sidebar in the css it DOES align right up at the top as I want it to. The minute you as a float:left or width or anything it jumps down to the end of the #masthead div and beginning of the #content div. Im pretty sure I have everything lined up correctly I just cant figure out why this is doing that.
    First of all, you're using an incomplete doctype, so browsers are rendering the page in quirks mode, which is a bad thing. You should use a complete doctype (one that includes a URL) to get browsers to render as close to the same as possible. I recommend HTML 4.01 Strict. A doctype is not a magic fix. It is the first step in the process of fixing your page.
    Activating the Right Layout Mode Using the Doctype Declaration
    Fix Your Site With the Right DOCTYPE!
    Choosing a DOCTYPE
    Doctype switching
    Rendering Mode and Doctype Switching
    http://www.w3.org/QA/2002/04/Web-Quality
    http://www.w3.org/QA/2002/04/valid-dtd-list.html

    2) Actually the stylesheet is http://stolen-bikes.org/css/non_ie2.css

    3) <br /> is not valid HTML. It's XHTML. You should remove the " /" from the end of all start tags for elements that are not allowed to have an end tag in HTML, e.g. <meta>, <link>, <img>, and <br>.

    4) Check out this article and this demo from it.

    5) Don't forget to make sure that the (X)HTML and CSS code you write is valid.

    Thanks

    Computer Repairs Brisbane

    887 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.