I'm not sure if it's something I've doing wrong or if it's a bug that I've come across. I'm hoping for some advice.
On my homepage I am showing the latest news:
<% control PublishedNews(5) %> <div class="container"> <h3><a href="$Link">$Title.XML</a></h3> <p class="date">$Date.Long</p> <div>$Content.Summary(20) <a href="$Link">more...</a></div> </div> <% end_control %>
PublishedNews() is a function in HomePage.php that does a DataObject::get() on news items that have been published.
But the above template code generates this error:
"[Warning] SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 2: parser error : Extra content at the end of the document"
I believe it's because there's a link in the content that extends past the 20 characters, and the XML parser is seeing this and choking.
What could I do to prove this theory? What can I do to get around this?
I want to have HTML formatting and links in the news summary. As far as I can see, Summary() is the only method that will give me HTML.