There is an arrow button right to the insert link button. When users click this arrow button, the internal links treeview will display. The internal links is a convenient tool for inserting pre-defined hyperlinks. It can be used to display the internal links of the website or frequently used links. You can create a custom links treeview programmatically or by modifying the richtexteditor\config\staticlinks.xml.

How to disable internal links treeview?

If you want to disable the internal links treeview, you can set Editor.DisableStaticLinks Property to true.

<RTE:Editor runat="server" ID="Editor1" DisableStaticLinks="true" />

Add custom links by editing the staticlinks.xml file

The staticlinks.xml file can be found in the richtexteditor/config folder. In staticlinks.xml file you can find the following code which defines the internal links information within RichTextEditor. By default, internal links treeview has the following settings:

<links>
      <group text="Websites">
            <group text="CuteSoft">
                  <link text="Cute Chat" href="http://cutesoft.net/ASP.NET+Chat/" />
                  <link text="Cute Live Support" href="http://cutesoft.net/live-support/" />
                  <link text="Web Messenger" href="http://cutesoft.net/web-messenger/" />
                  <link text="Ajax Uploader" href="http://ajaxuploader.com" />
            </group>
            <link text="RichTextEditor" href="http://www.richtexteditor.com" />
            <link text="Free Live Chat" href="http://www.mylivechat.com" />
            <link text="Free Javascript Obfuscator" href="http://www.javascriptobfuscator.com" />
      </group>
</links>

Programmatically add custom links

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

Property Description
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:


Send feedback about this topic to CuteSoft. © 2003 - 2018 CuteSoft Components Inc. All rights reserved.