Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Content Editor Discussions /

Forum for content editors and CMS users.

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

Content appearing in sidebar and not on main page


Go to End


5 Posts   3335 Views

Avatar
jwsgoldsilver

Community Member, 3 Posts

8 January 2009 at 5:08pm

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?

Avatar
Willr

Forum Moderator, 5523 Posts

8 January 2009 at 7:39pm

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)

Avatar
jwsgoldsilver

Community Member, 3 Posts

8 January 2009 at 8:52pm

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.

Avatar
Carbon Crayon

Community Member, 598 Posts

8 January 2009 at 10:48pm

Edited: 08/01/2009 10:54pm

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.

Avatar
jwsgoldsilver

Community Member, 3 Posts

10 January 2009 at 10:48am

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.