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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Creating a link breaks page rendering?


Reply


4 Posts   681 Views

Avatar
scpi

Community Member, 21 Posts

6 January 2011 at 8:16am

I'm having a strange problem that I haven't had much luck solving.
I'm on SS version 2.4.2.

I have one specific page where, if I try to add a link anywhere in the page, the page renders without the main Content area. I get the header, footer, navigation, and everything else, but the content area is empty. It happens no matter what page I create a link to. And I don't have this problem with any other page on the site.

This is largest page on the site, and it also changes the most frequently. Other than that though, I don't think there's anything special about it. There's nothing wrong I can see with the HTML in the page, and nothing is showing up in my PHP error logs. I'm starting to think there could be bad data in my database somewhere, but I don't even know where to begin to look.

Has anybody had anything like this happen to them, or at least have some ideas for the next step in troubleshooting?

-scott

Avatar
dendeffe

Community Member, 135 Posts

6 January 2011 at 8:39am

What's your template like? What does it output? Any special functions in your Model/controllers? Parsing stuff (something along these lines http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/) Any special _config.php settings? What do you see in the source code editor in the CMS?

Avatar
scpi

Community Member, 21 Posts

6 January 2011 at 9:07am

Source view in the CMS is totally normal. The template outputs a normal HTML page, it's just missing everything from the Content area. There's not much really special in my code, and the code hasn't even changed recently! I'm starting to think there might be corrupt data in the database.

Using var_dump($this) in my Page_Controller index shows that all the content is there in the Page object.

If I code the link by hand as <a href="/example-page/">link</a>, it works fine.
If I create the link in the CMS so it's <a href="[sitetree_link id=42]">link</a>, it breaks.

Avatar
dendeffe

Community Member, 135 Posts

6 January 2011 at 8:59pm

Not sure how the links are rendered for the frontend. But I think sapphire/parsers might be a good place to start to see if something there clashes with some code you are having.