create a datatype with the tinymce editor associated, then a document type that uses it, then a page template for the document type, and there you have a "custom" page that holds an editor ?
I've added the control just you have it in your post and the control is not rendering in the custom edit page. On the code-behind I set the Text property to the data in the DB and still nothing.
Can you provide some code on how you added the control and what the code is on the cs file?
I just got the custom section working and I need to have the ability to edit html so that I can consume the html from various pages. This html needs to be content managed so that the end user can make the changes. I don't want to use an XSLT b/c the end user should not have access to the XSLT.
I would like to re-open this thread. There doesn't seem to be a solution to using TinyMCE in a custom administration section as it would be seen in the content section.
The toolbar ends up underneath the editor. Has anyone resolved this?
So no one has implemented TinyMCE adding the toolbar to the top of the page? Seems like no one has actually intergrated anything useful into umbraco on a large scale?
Have you found a solution to this? I have created a custom Company Database and I am trying to integrate tinymce into the edit company interface. I have managed to add the standard tinymce as shown in this screenshot but it would be better if I could use the Umbraco version so that I can have access to the Umbraco Media Library.
/// <summary> /// Adds/puts a TinyMCE control onto the page. /// </summary> /// <param name="control">The Umbraco TinyMCE control</param> /// <param name="controlId">Whatever you want to name it (eg. txtDescription)</param> /// <param name="placeHolder">The PlaceHolder control, in which you want to put this TinyMCE</param> /// <param name="tab">The Umbraco tab (custom section) in which menu bar you want to put the TinyMCE controls</param> private static void PutTinyMce(ref TinyMCE control, string controlId, PlaceHolder placeHolder, TabPage tab) { DataTypeDefinition d = DataTypeDefinition.GetDataTypeDefinition(-87); // TinyMCE DataType (could be your own datatype)
control = (umbraco.editorControls.tinyMCE3.TinyMCE)d.DataType.DataEditor; control.ID = controlId; placeHolder.Controls.Add(control); tab.Menu.NewElement("div", "umbTinymceMenu_" + control.ClientID, "tinymceMenuBar", 0); // Add TinyMCE controls to menu bar }
Sorry I know this is an old post but I am trying to do this myself. I have an Umbraco 4.7.1.1 website and I have copied the code above but I am getting and error with the following line:
TabPage tabProducts = (TabPage)Web.FindControlRecursive(this.Page.Master, "dashboardTabs_tab01layer"); // The tab in Umbraco custom section
The error is "The name 'Web' does not exist in the current context"
I have the following references in my code:
using umbraco.uicontrols; using umbraco.editorControls.tinyMCE3; using umbraco.BusinessLogic; using umbraco.cms.businesslogic; using umbraco.cms.businesslogic.datatype;
Does anyone know what I am missing or doing wrong? Would really appreciate any help
Sorry that's just a helper function I wrote to find the tab control. Here is the code
/// <summary> /// Finds a Control recursively. Returns the first control that matches, or null if not found. /// </summary> /// <param name="root">eg. this.Master</param> /// <param name="controlId">eg. "txtName"</param> /// <returns></returns> public static Control FindControlRecursive(Control root, string controlId) { if (root.ID == controlId) return root;
foreach (Control c in root.Controls) { Control foundCtrl = FindControlRecursive(c, controlId); if (foundCtrl != null) return foundCtrl; }
I have now got this working although I have one other question that I am hoping you or someone else may be able to answer. Is it possible for me to add extra plugins to this Rich Text Editor but not affect the default Rich Text Editors in the rest of the site? For example if I wanted to use the legacyoutput plugin just for this one control?
I tried adding the following into the code but it doesn't seem to have had any effect, when I look at the source of the RTE in Umbraco it just shows all the plugins that Umbraco adds and does not add my extra one to it. Any ideas?
This is what I tried adding just before control.ID = controlid:
Another thing that I might like to be able to do is remove plugins, for example remove the Styles dropdown from the toolbar which I assume is related to the umbracocss plugin?
I haven't tried creating a new Datatype but although doing that may allow me to turn on and off some features it would not allow me to add plugin's like legacyoutput which are not listed as options for the Rich Text Editor in the Umbraco datatypes section. Maybe I need to start a new post on the forum to see if anyone has any ideas about this one.
Use Umbraco TinyMCE Editor in Custom Page
How can I use the Umbraco TinyMCE editor in my own custom asp.net page? I can't see to get it to work.
Hi
You need to download the tinymce script from here http://tinymce.moxiecode.com/
You can see examples on how to set it up here: http://tinymce.moxiecode.com/examples/full.php
Hope this is what you're looking for.
/Jan
Jan, well, I know I can do that. I mean use the Umbraco UI control specifically rather than duplicate functionality that's already there.
please elaborate ?
create a datatype with the tinymce editor associated, then a document type that uses it, then a page template for the document type, and there you have a "custom" page that holds an editor ?
Rik, by "custom page", I mean an asp.net page I'm adding to Umbraco. Anyway, I kind of figured it out:
<%@ Register TagPrefix="umb1" Namespace="umbraco.editorControls.tinyMCE3.webcontrol" Assembly="umbraco.editorControls" %>
....
<umb1:TinyMCEWebControl runat="server" ID="tinymce1" Rows="8" Columns="50" Height="300" Text='<%# Bind("description") %>' />
The only thing is the toolbar shows up below the text field and I'm not sure how to configure the buttons...
Robert,
I've added the control just you have it in your post and the control is not rendering in the custom edit page. On the code-behind I set the Text property to the data in the DB and still nothing.
Can you provide some code on how you added the control and what the code is on the cs file?
I just got the custom section working and I need to have the ability to edit html so that I can consume the html from various pages. This html needs to be content managed so that the end user can make the changes. I don't want to use an XSLT b/c the end user should not have access to the XSLT.
Any other solution would be appreciated.
I would like to re-open this thread. There doesn't seem to be a solution to using TinyMCE in a custom administration section as it would be seen in the content section.
The toolbar ends up underneath the editor. Has anyone resolved this?
So no one has implemented TinyMCE adding the toolbar to the top of the page? Seems like no one has actually intergrated anything useful into umbraco on a large scale?
Hi Daniel,
Have you found a solution to this? I have created a custom Company Database and I am trying to integrate tinymce into the edit company interface. I have managed to add the standard tinymce as shown in this screenshot but it would be better if I could use the Umbraco version so that I can have access to the Umbraco Media Library.
http://www.marclove.co.uk/stuff/SupplierDatabase.png
Cheers,
Marc
Hi Daniel and Marc,
Check my last post on this topic: http://our.umbraco.org/forum/developers/extending-umbraco/6863-Datatype-on-normal-page-or-UserControl. Here I explain how the TinyMCE editor can be used on a custom page. It's a bit tricky but it works!
Jeroen
Cheers Jeroen, I will give this a go.
I was struggling with this too. I couldn't find any straightforward and simple answer. The solution is only a simple function. Here it is.
In .ascx file:
In .cs file:
Hope it helps someone.
Hi,
Sorry I know this is an old post but I am trying to do this myself. I have an Umbraco 4.7.1.1 website and I have copied the code above but I am getting and error with the following line:
TabPage tabProducts = (TabPage)Web.FindControlRecursive(this.Page.Master, "dashboardTabs_tab01layer"); // The tab in Umbraco custom section
The error is "The name 'Web' does not exist in the current context"
I have the following references in my code:
using umbraco.uicontrols;
using umbraco.editorControls.tinyMCE3;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.datatype;
Does anyone know what I am missing or doing wrong? Would really appreciate any help
Regards
Tony
Hi Tony,
Sorry that's just a helper function I wrote to find the tab control. Here is the code
Thanks Hardi,
I have now got this working although I have one other question that I am hoping you or someone else may be able to answer. Is it possible for me to add extra plugins to this Rich Text Editor but not affect the default Rich Text Editors in the rest of the site? For example if I wanted to use the legacyoutput plugin just for this one control?
I tried adding the following into the code but it doesn't seem to have had any effect, when I look at the source of the RTE in Umbraco it just shows all the plugins that Umbraco adds and does not add my extra one to it. Any ideas?
This is what I tried adding just before control.ID = controlid:
control.Plugins = legacyoutput";
Another thing that I might like to be able to do is remove plugins, for example remove the Styles dropdown from the toolbar which I assume is related to the umbracocss plugin?
I'm not quite sure... have you tried creating a new DataType?
Hi Hardi,
I haven't tried creating a new Datatype but although doing that may allow me to turn on and off some features it would not allow me to add plugin's like legacyoutput which are not listed as options for the Rich Text Editor in the Umbraco datatypes section. Maybe I need to start a new post on the forum to see if anyone has any ideas about this one.
Anyone knows how to do this in V5?
How Can we do the same in V8 with MVC?
is working on a reply...