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.

Archive /

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

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

Phantom Paragraph Tags

Go to End

5 Posts   2670 Views


43 Posts

15 August 2008 at 6:14am


When viewing my published site, I am finding three pairs of phantom paragraph tags <p></p> in one particular section of the page. They are actually appearing in the presentation of the page (see attached image), not just in the source code. I've scoured the template for that page and can't find where these tags are coming from. I've also checked to make sure that there are no hard paragraph breaks in the CMS that could be causing it. Has anyone experienced this before?
I've isolated it to one section of code in my template (see below), but am complete boggled as to where these tags are coming from. Anyone have any insight?


The snippet of code in which the tags are coming from:

<!-- Begin Blue Content Area -->
				<div id="contentBandBlue">
					<div id="contentBlue">
						<!-- Begin Left Column -->
						<div id="leftColumnHome">
						<!-- End Left Column -->
						<!-- Begin Middle Column -->
						<div id="midColumn">
						<!-- End Middle Column -->
						<!-- Begin Right Column -->
						<div id="rightColumnHome">
						<!-- End Right Column -->
				<!-- End Blue Content Area -->


43 Posts

15 August 2008 at 6:16am

Here's the image. I forgot to upload it in the previous post.


43 Posts

15 August 2008 at 7:08am

I just tried adding content via the CMS in the area where these mysterious tags are appearing, and it won't render it. I just displays the actual code. This makes me think I have an unclosed tag somewhere, but I can't seem to find one. This is so odd...


43 Posts

15 August 2008 at 7:15am

Just in case, here's what the pagetype looks like:

 * Defines the HomePage page type
class HomePage extends Page {

	static $db = array(
	'BlueContent' => 'Text',
	'LeftColContent' => 'Text',
	'MidColContent' => 'Text',
	'RightColContent' => 'Text'

	function getCMSFields() {
	$fields = parent::getCMSFields();
	$fields->addFieldToTab('Root.Content.Blue', new HtmlEditorField('BlueContent', 'Blue Conent'));
	$fields->addFieldToTab('Root.Content.LeftCol', new HtmlEditorField('LeftColContent', 'Left Col Conent'));
	$fields->addFieldToTab('Root.Content.MidCol', new HtmlEditorField('MidColContent', 'Mid Col Conent'));
	$fields->addFieldToTab('Root.Content.RightCol', new HtmlEditorField('RightColContent', 'Right Col Conent'));
	return $fields;
	static $has_one = array(
   static $icon = "tutorial/images/treeicons/home";
class HomePage_Controller extends Page_Controller {


Forum Moderator, 5523 Posts

15 August 2008 at 1:03pm

The problem is you have defined your database fields as Text fields. This is plain text (eg not going to be rendered as HTML) yet you use HTMLEditorFields to edit it which will allow HTML but because it is a text field in the database thats what it outputs it as.

Silverstripe should warn you about this bug - make sure you have error_reporting() on. But the fix is simple, change your Database fields to HTMLText or change the cms boxs to TextareaFields() rather then HTMLEditors if you only intend on using plain text