Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Getting error "EntityRef"

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

Page: 1
Go to End
Author Topic: 7478 Views
  • HitByLife
    Avatar
    Community Member
    6 Posts

    Getting error "EntityRef" Link to this post

    I have installed SS on a client site and I am in the process of implementing the design I have created for the site. I thought I had followed the SS conventions correctly, but it does not turn out right at the moment. I'm getting the following error with a broken design:

    This page contains the following errors:

    error on line 51 at column 11: EntityRef: expecting ';'
    Below is a rendering of the page up to the first error.

    I have checked my Page.ss files, but see nothing wrong.

    Any help is much appreciated.

  • HitByLife
    Avatar
    Community Member
    6 Posts

    Re: Getting error "EntityRef" Link to this post

    Hm, looks as if it was caused by an error in the syntax; "&Layout" for "$Layout." It's just that I spotted it, fixed it, and it was still the same. So, I left it, and the day after, when going back to work on it, it worked. Strange.

  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Re: Getting error "EntityRef" Link to this post

    Where is the best place to start looking when seeing error message like:

    <code>
    error on line 74 at column 64: EntityRef: expecting ';'
    </code>

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Getting error "EntityRef" Link to this post

    It means you have a malformed entity in your (X)HTML. Example for entities: &quot; &amp; &laquo; etc.
    It could be in your template (search .ss files), or maybe you have an ampersand in a Title field and you forgot to escape it? To correctly escape textfields like Title use: $Title.XML in your template (and $Title.ATT in attributes).

  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Re: Getting error "EntityRef" Link to this post

    There is still is a problem when viewing the page in any of the stage or when I flush the page. I think it's to do with the DataObjectSet

    I get this problem with: http://doc.silverstripe.org/doku.php?id=private:recipes:pagination

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Getting error "EntityRef" Link to this post

    If you get the problem when using pagination, there's most likely an error in the pagination template.
    Just out of curiosity, do you have a <?xml version="1.0" encoding="UTF-8"?> header in your source code (Page.ss)? If yes, remove it.

  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Re: Getting error "EntityRef" Link to this post

    Yes it was and removing it solve the problem. Do you know why it was there in the first place?

  • juliuy
    Avatar
    Community Member
    1 Post

    Re: Getting error "EntityRef" Link to this post

    I have a similar issue. I have a controller in ChartPage.php which has a method ShowChart() returning this value:

    <img name="WebChartViewer" src="ChartDirector/phpdemo/getchart.php?img=chart1&id=591de62d3e3e0486f741c37bada0ae3b4d500333e0f33&" align="left" border="0" usemap="#WebChartMap"/>

    In layout template ChartPage.ss I write $ShowChart to display that value. But I get that very same error you are talking here about.

    I can write $ShowChart.XML, but then all my '<', '>' and other symbols are escaped. I am a newbie to SilverSprite, so I am kind of surprised that I can't return a string using controller's method if that string has some special symbols. What would be your advice about that?

    Julius

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