Jump to:

517 Posts in 247 Topics by 260 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » Content appearing in sidebar and not on main page

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 1897 Views
  • jwsgoldsilver
    Avatar
    Community Member
    3 Posts

    Content appearing in sidebar and not on main page Link to this post

    My site: www.jwsgoldsilver.com

    Without me doing anything, my main content is now appearing in the right hand sidebar. This is the error I get on Mozilla when I load the page:
    XML parsing error: mismatched tag. Expected: </p>.
    Location: http://www.jwsgoldsilver.com/
    Line 73, Column5:

    </div>
    --------------------------^

    Any ideas? How does one edit the silverstripe code dwon to the level required to fix this?

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Content appearing in sidebar and not on main page Link to this post

    It looks like your html is being sent as strict XML and you are missing a </p> tag. So 2 ways to solve this. Add the </p> in your template where you are missing it (i haven't looked as to where) or remove the <? xml ?> header from you Page.ss file in the themes/yoursitetheme/templates/ folder (it should be the top line)

  • jwsgoldsilver
    Avatar
    Community Member
    3 Posts

    Re: Content appearing in sidebar and not on main page Link to this post

    Thanks. I deleted the xml tag on the page.ss and the error disappears from Mozilla. However, the main content frame is still empty and the content is in the side bar. The main content should begin with "Buy gold to protect your wealth..." and continues to "Regards, Andrew Smith". Bit of a puzzle as to why this is in the sidebar.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Content appearing in sidebar and not on main page Link to this post

    Hi jwsgoldsilver

    Its because you have 2 sidebox divs and you have not closed one of them before opening the main div. Really you should only have one. So you need to remove this one:

       
          <div id="sidebar" >
                         
             <div class="sidebox">   

             <p><a href="http://www.jwspaidtosave.com/gold-silver/">Sign up here to Joseph Wealth Systems</a></p>
             
                <h1>Gold is Money</h1>
                <p></p>

           <div class="sidebox">   <!--   **** REMOVE THIS LINE **** -->
                <h1>Wise Words</h1>
                <p></p>               
                <p class="align-right"></p>
                   
             </div>      
             

    You general page structure is quite messy, you have way more divs than you need. I find the blackcandy template is a good place to start as it has very nicely structured html and will make sure you avoid issues like this

    I would also recommend the firefox developer toolbar or firebug as they allow you to analyse the structure of your page and debug problems like this. You could also use a text editor like aptana (or even dreamweaver...*shudder* ) which will highlight corresponding tags, so you can find which tags do not close.

  • jwsgoldsilver
    Avatar
    Community Member
    3 Posts

    Re: Content appearing in sidebar and not on main page Link to this post

    Thanks Aram. Very helpful.

    It appears I was missing a </div> at the end of the file. I will use your recommendations in the future to find faulty code. Also a folder called silverstripe_cache was not around. Don't know how that wasn't there in the first place. All good now and thanks all for being so helpful.

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