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 -->
<!-- Begin Left Column -->
<!-- End Left Column -->
<!-- Begin Middle Column -->
<!-- End Middle Column -->
<!-- Begin Right Column -->
<!-- End Right Column -->
<!-- End Blue Content Area -->
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...
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