Copied to clipboard

Flag this post as spam?

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


  • adamsimsy 31 posts 46 karma points
    May 09, 2011 @ 15:00
    adamsimsy
    0

    Custom buttons in content view

    I've had a good search within the commuity for guides or solutions which people have found through the forum but wasn't lucky enough to find anything that helped.

    So what i was wondering if anyone could point me in the direction or provide some guideance for how to add a custom button/action next to the buttons in the content view for a node. E.g a new custom approval button next to the save and submit for approval buttons.

    Thanks in advance for any help provided. 

    Adam

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 09, 2011 @ 15:33
    Jeroen Breuer
    0
  • adamsimsy 31 posts 46 karma points
    May 09, 2011 @ 17:15
    adamsimsy
    0

    Thank you Jeroen for the reply. It's a nice package which i'll bare in mind for the future but what i was looking for was the ability to add a button to the top bar.

    See below example below.

      

    I'd like to be able to add a custom menu to this bar and possibly next to the 'save' / 'publish' options which i don't think that package covers. Unless i've read the description in-correctly?

    Cheers.

    Adam

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 09, 2011 @ 17:32
    Jeroen Breuer
    0

    Hello,

    You're right that package is for the menu in the tree. Perhaps this wiki page can be more of help, but it's only for the editor: http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/how-to-add-extra-html-functionality-to-tinymce

    Jeroen

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 09, 2011 @ 17:42
    Tom Fulton
    2

    Hi Adam,

    If you have an umbraco.tv subscription, there is a tutorial on "Modifying the backend UI with page events" which gives a basic example of adding buttons to the toolbar.  Basically you need to attach to the umbracoPage.Load event and insert the buttons.  Below is some basic code I have used to do this in the past:

            void  umbracoPage_Load(object sender, EventArgs e)
            {
                umbracoPage page = (umbracoPage)sender;

                // Temp fix for some alignment issues
                string strCss = "<style type='text/css'>.mceToolbarExternal{left:108px;}</style>";
                page.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "cssfixtoolbar", strCss);

                if (page.Page.Request.Path.ToLower().Replace((GlobalSettings.Path + "/").ToLower(), "").Contains("editcontent.aspx"))
                {
                    Control control = ((ContentPlaceHolder) page.FindControl("body")).FindControl("TabView1");
                    if (control != null)
                    {
                        int nodeId = int.Parse(HttpContext.Current.Request.QueryString["id"]);

                        TabView view = (TabView) control;
                        foreach (TabPage page3 in view.GetPanels())
                        {
                            MenuIconI ni = page3.Menu.NewIcon(4);
                            ni.AltText = "View Page in Flash";
                            ni.OnClickCommand = string.Concat(new object[] { "window.open('/?start=", nodeId, "&mode=flash&isPreview=1','flashPreview')" });
                            ni.ImageURL = "/media/assets/icons/preview-flash.png";

                            MenuIconI ni2 = page3.Menu.NewIcon(5);
                            ni2.AltText = "View Page in Text View";
                            ni2.OnClickCommand = string.Concat(new object[] { "window.open('", umbraco.library.NiceUrl(nodeId),"?isPreview=1','textPreview')" });
                            ni2.ImageURL = "/media/assets/icons/preview-text.png";
                        }
                    }
                }
            }

    Hope this helps,
    Tom

  • adamsimsy 31 posts 46 karma points
    May 16, 2011 @ 17:22
    adamsimsy
    0

    Thanks Tom for your help.

    Adam

Please Sign in or register to post replies

Write your reply to:

Draft