Dynamically fill Link List like staticlinks.xml

Last post 10-07-2013, 8:38 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  09-29-2013, 5:31 PM 78033

    Dynamically fill Link List like staticlinks.xml

    Dear Cutesoft,

    in directory config I see a static file "staticlinks.xml" to fill the links.

    How can I add my link list dynamically in code behind so they appear in Editor?

    An example would be great.

    Thank you!


  •  10-07-2013, 8:38 AM 78063 in reply to 78033

    Re: Dynamically fill Link List like staticlinks.xml

    Hi miller399,

     

    Please refer to http://richtexteditor.com/document/scr/html/custom-links-dropdown.htm, it shows you how to custom the links Programmatically.

     

    Programmatically add custom links

    RichTextEditor provides a few powerful properties that allow you programmatically manage the custom internal links.

    PropertyDescription
    Editor.LinkGroupArray
    
    An array of link groups which will be displayed in internal links treeview as treenode.
    Editor.LinkItemArray
    
    An array of predefined hyperlinks which will be displayed in internal links treeview as treeitem.
    Editor.LinkUrlArray
    
    An array of xml files. Those xml files should contain predefined set of hyperlinks which will be displayed in the internal links treeview. editor.LinkUrlArray = new string[] { "mylinks.xml"};

    Code Example:

               _editor.LinkUrlArray = new string[] { "mylinks.xml"};
                
                _editor.DisableStaticLinks = true;
    
                _editor.LinkItemArray = new RTEDataItem[]{
                      new RTEDataItem("Intel","http://www.intel.com/"),
                      new RTEDataItem("AMD","http://www.amd.com/")
                };
    
                RTEDataGroup group1 = new RTEDataGroup("Portals");
                group1.Items = new RTEDataItem[]{
                      new RTEDataItem("MSN","http://www.msn.com/"),
                      new RTEDataItem("Yahoo","http://www.yahoo.com/")
                };
                RTEDataGroup group2 = new RTEDataGroup("Shopping");
                group2.Items = new RTEDataItem[]{
                      new RTEDataItem("Amazon","http://www.amazon.com/"),
                      new RTEDataItem("Bestbuy","http://www.bestbuy.com/")
                };
    
                _editor.LinkGroupArray = new RTEDataGroup[] { group1, group2 };
                
    

    The above code will create the following custom links treeview:

     

    Regards,

     

    Ken 

View as RSS news feed in XML