Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rasmus Beuchert 14 posts 35 karma points
    Jan 15, 2010 @ 10:17
    Rasmus Beuchert
    0

    Using umbraco data types in frontend website (specifically in usercontrols)

    Hi,

    I have the need to use the RichTextEditor (TinyMCE) from the umbraco backend in my frontend website.
    So my question is if it is possible to use the umbraco data types in my own usercontrol?

    Best regards
    Rasmus

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 15, 2010 @ 11:24
    Lee Kelleher
    0

    Hi Rasmus,

    Yes, it's definitely possible.  There are 2 options...

    1. The quick way - use Doc2Form, (previously known as AutoForm / AutoFormPlus), create a new doc-type and use that in the Doc2Form macro.

    2. Custom code.  Requires C# (VB.NET) knowledge... Try taking a look at the Doc2Form source on CodePlex:

    http://umbracoext.codeplex.com/sourcecontrol/changeset/view/45140?projectName=umbracoext#97254

     

    Option 1 is definitely quicker to put in place ... and you have the choice of saving the form data as a node and/or emailing it out.

    Good luck, Lee.

  • Rasmus Beuchert 14 posts 35 karma points
    Jan 15, 2010 @ 13:14
    Rasmus Beuchert
    1

    Thank you

    I managed to look through the source code from Doc2Form, and I got the tinyMCE editor in my usercontrol (but without the extra umbraco functions)

                DocumentType dtt = DocumentType.GetByAlias("MyDocumentType");
                PropertyType pt = dtt.getPropertyType("MyProperty");

                IDataType dt = pt.DataTypeDefinition.DataType;
                dt.DataEditor.Editor.ID = pt.Alias;
                IData df = pt.DataTypeDefinition.DataType.Data;
                placeholder.Controls.Add(dt.DataEditor.Editor);

    But I've come to another conclusion, and I'm not gonna use it this way anyways.

    But thank you very much for your help.

    Rasmus

Please Sign in or register to post replies

Write your reply to:

Draft