Jump to:

5516 Posts in 1734 Topics by 1221 members

Customising the CMS

SilverStripe Forums » Customising the CMS » CMS Pages like tree structure Silverstripe 3

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

Page: 1
Go to End
Author Topic: 527 Views
  • SS_Learner
    Avatar
    Community Member
    18 Posts

    CMS Pages like tree structure Silverstripe 3 Link to this post

    Hi Friends..

    I was looking a way to make another menu in CMS which will show my own tree structure (not the pages) in Silverstripe 3 ..
    I know it uses the jstree for this,but i need a way to start,any help is appreciated.

    Thanks

  • SS_Learner
    Avatar
    Community Member
    18 Posts

    Re: CMS Pages like tree structure Silverstripe 3 Link to this post

    I added a div with id demo and i know that the jquery.jstree.js is included as soon as the cms is opened in silverstripe 3.
    In the init() function u included the my javacrript to create the jstree in the div demo.
    and my js code is this:

       $("#demo").jstree({
          "json_data" : {
             "data" : [
                {
                   "data" : "A node",
                   "metadata" : { id : 23 },
                   "children" : [ "Child 1", "A Child 2" ]
                },
                {
                   "attr" : { "id" : "li.node.id1" },
                   "data" : {
                      "title" : "Long format demo",
                      "attr" : { "href" : "#" }
                   }
                }
             ]
          },
          "plugins" : [ "themes", "json_data", "ui" ]
       }).bind("select_node.jstree", function (e, data) { alert(data.rslt.obj.data("id")); });

    But i am not able to show any tree in the demo div.
    May be i am missing any file or may be some other issue,i am not abe to find any javascript error in console.
    Can someone help me with this please?
    Thanks

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: CMS Pages like tree structure Silverstripe 3 Link to this post

    Hi SS_Learner,

    did you find any solution for your problem?

    Best regards,
    chrclaus

  • SS_Learner
    Avatar
    Community Member
    18 Posts

    Re: CMS Pages like tree structure Silverstripe 3 Link to this post

    Hi chrclaus..
    I was able to do this jstree in silverstripe 3 CMS,my issue at that time was my javascript for the js tree was loading after the div making the jstree..
    Then i included my jstree javascript code in ss file,and it all worked as i wanted to..

    Thanks

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: CMS Pages like tree structure Silverstripe 3 Link to this post

    Hi SS_Learner,

    is it possible for you to explain your solution more in detail? I have no idea where to start (which class I should extend ...). I think, modelAdmin is not the richt choice, isn´t it?

    Best regards,
    chrclaus

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