Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

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

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

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

Page: 1
Go to End
Author Topic: 938 Views
  • rach99
    Avatar
    Community Member
    3 Posts

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

    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" 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!

  • rach99
    Avatar
    Community Member
    3 Posts

    Re: Error in Ajax evaluator on line 973: syntax error var tree = $('sitetree'); Link to this post

    SIGH....

    Ok so i took out the html code...

    fixed. lol

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