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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

Error in Ajax evaluator on line 973: syntax error var tree = $('sitetree');


Go to End


2 Posts   1214 Views

Avatar
rach99

Community Member, 3 Posts

20 August 2008 at 5:21pm

Hi There,

I have been working through the tutorial with a fresh install of ss and all the pages show up fine in the CMS but when i go to create a new page at all ArticlePage or just a plain page i get this error:

Error in Ajax evaluator on line 973: syntax error var tree = $('sitetree'); var newNode = tree.createTreeNode("16", "New ArticlePage", "ArticlePage"); node = tree.getTreeNodeByIdx(13); if(!node){ node = tree.getTreeNodeByIdx(0); } node.open(); node.appendTreeNode(newNode); newNode.selectTreeNode();

This is my php code in the ArticlePage.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
</head>

<?php
/**
* Defines the ArticlePage page type
*/
class ArticlePage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);
static $has_one = array(
);
}

class ArticlePage_Controller extends Page_Controller {

function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');

return $fields;
}

}

?>
</body>
</html>

I am newish to php and would not realise if i had the code in the wrong order.

Any help would be great as I would love to get this tutorial completed!

Avatar
rach99

Community Member, 3 Posts

20 August 2008 at 6:20pm

SIGH....

Ok so i took out the html code...

fixed. lol