Copied to clipboard

Flag this post as spam?

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


  • marthin 87 posts 106 karma points
    Feb 03, 2010 @ 11:17
    marthin
    0

    Add the RichTextEditor to TabView

    Hi,

    Im trying to create a TabView with a couple of umbraco panels. i would like one of theses to contain the richtexteditor used in umbraco and also be able to have the save button to save the html generated by the editor. Has anyone created something like this?

    Is is possible to just add the usercontrol in someway?

    Best Regards

    Marthin

  • Seth Niemuth 275 posts 397 karma points
    Feb 03, 2010 @ 14:57
    Seth Niemuth
    0

    What do you mean by a TabView? If you want to add a richtext editor to the front end of your site, you may just want to look at TinyMCE directly (that is the rich text editor that umbraco uses. You can add a usercontrol to your page with a macro (In the developer Section). You just select a usercontrol use to use with the macro. ('Developers' < 'Macros'). Then, there are buttons in the template and in the rich text editor of the content area to add a macro.

    If you mean in the backend, you add a richtext editor to a page/node in 'Settings < Document Types'. You then use that alias for your richtext editor (set in your document type) in your template and it outputs the HTML that was saved from your richtext editor. 

  • marthin 87 posts 106 karma points
    Feb 03, 2010 @ 16:46
    marthin
    0

    I would like to have it in a custom section in the backend and the entered text will then be saved in a DB.

    I need to do this by code not by any settings in Umbraco UI.

    Right now i'v got:

    ----------------------

    <%@ Register Namespace="umbraco" Assembly="umbraco" TagPrefix="umb"%>

    <%@ Register Namespace="umbraco.uicontrols" Assembly="controls" TagPrefix="cc1" %>

    <%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterpages/umbracoPage.master" validateRequest="false" CodeBehind="editProduct.aspx.cs" Inherits="Ecommerce.Products.editProduct" %>



    <asp:Content ID="Content" ContentPlaceHolderID="body" runat="server">       
            <cc1:TabView ID="tabControl" runat="server" Height="692px" Width="552px" />
              
               <cc1:Pane ID="ProductInfoPane" Height="600px" Width="330px" runat="server">
                <cc1:PropertyPanel runat="server" ID="pp_name">
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>   
                </cc1:PropertyPanel>
               
                <cc1:PropertyPanel runat="server" ID="pp_price">
                    <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>   
                </cc1:PropertyPanel>
               </cc1:Pane>
              
               <cc1:Pane ID="ProductDescriptionPane" Height="600px" Width="330px" runat="server">                    
                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Width="500px" Height="300px"></asp:TextBox>           
               </cc1:Pane>
              
               <cc1:Pane ID="ProductPropPane" Height="600px" Width="330px" runat="server">
                <cc1:PropertyPanel runat="server" ID="pp_picture">
                    <asp:Literal ID="lit_picture" runat="server" />
                </cc1:PropertyPanel>
               </cc1:Pane>
    </asp:Content>

    --------------------------

    AND in the code behind

    -----------------

    protected override void OnInit(EventArgs e)
            {
                // The info tab
                InfoTab = tabControl.NewTabPage(umbraco.ui.GetText("eCommerce", "tab_edit_product_info")); //change to xml lang
                InfoTab.Controls.Add(ProductInfoPane);

                var SaveButton = InfoTab.Menu.NewImageButton();
                SaveButton.ImageUrl = GlobalSettings.Path + "/images/editor/save.gif";
                SaveButton.AltText = umbraco.ui.GetText("buttons", "save");
                SaveButton.Click += new ImageClickEventHandler(Save_Info);
               

                // The description tab
                DescriptionTab = tabControl.NewTabPage(umbraco.ui.GetText("eCommerce", "tab_edit_product_description")); //change to xml lang           
                DescriptionTab.Controls.Add(ProductDescriptionPane);

             }

    ------------

    So what I whant is fore the Description TAB to implment a richtexteditor and when i press save i will call the action for saving the genereated HTML to my custom DB.

    Thx for helping out!

    /M

     

  • Seth Niemuth 275 posts 397 karma points
    Feb 03, 2010 @ 17:22
    Seth Niemuth
    0

    If you are creating a custom section that saves to a custom DB, why do you want to do it within umbraco? It may be easier to create the stuff you want in content and create an actionhandler that saves it to your custom database when it gets saved in content: http://umbraco.org/documentation/books/creating-and-using-an-action-handler

  • Seth Niemuth 275 posts 397 karma points
    Feb 03, 2010 @ 17:39
  • marthin 87 posts 106 karma points
    Feb 04, 2010 @ 11:48
    marthin
    0

    Hi again,

    Yes that is exactly what im trying to do. Iv got a sample picture that you can look at to see how it looks like right now.picture link. Woulde be awsome if someone knows how to solve this.

    Best Regards

    Marthin

Please Sign in or register to post replies

Write your reply to:

Draft