I would like a button that inserts an Iframe with a predefined link. The reason I would like that is so that in Wiki, I can insert a menu on top of every wiki. When a user create a new page, all he would have to do is press the button to insert the menu (iframe)?
Any Idea?
Antoine
2 Answers, 1 is accepted
0
Rumen
Telerik team
answered on 15 Oct 2007, 01:22 PM
Hi Antoine,
To add a custom toolbar button to RadEditor in a Wiki scenario, open the file and put the following red marked tag:
<root> <tools name="EnhancedToolbar" dockable="false" enabled="true"> <tool name="Custom1" iconurl="<a path to an image file>" /> ...
Save the file. This will render a button on the toolbar. After that open the Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\RadEditorList.ascx file and put the red market JAVASCRIPT code in it:
<SharePoint:RenderingTemplate ID="RichTextField" runat="server"> <Template> <telerik:RadHtmlListField id="RadTextField" runat="server" /> <script type="text/javascript"> RadEditorCommandList["Custom1"] = function(commandName, editor, oTool) { // Execute your code here, provide it with any arguments that you need, etc. editor.PasteHtml("test"); }; </script> .... </Template> </SharePoint:RenderingTemplate>
This code will attach a function to the custom button, which will be executed when the user click on the button. In our scenario, the PasteHtml function will insert the sting test in the content area.