Copied to clipboard

Flag this post as spam?

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


  • Giuseppe 34 posts 56 karma points
    Jan 10, 2012 @ 12:29
    Giuseppe
    0

    Handle Proprieties tab by code

    Hi guys,

    I need to handle Properties tab and its content through umbraco code and change it with customer's specification. Could you please indicate me where proprieties are managed in source cose? I see the source but I don't find it.

    Thanks a lot

    Giuseppe

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 10, 2012 @ 15:07
    Tom Fulton
    0

    Hi Giuseppe,

    Check in /umbraco/editContent.aspx.cs for the controls

    The best method might be to use AppBase to inject some jQuery into the page to do what you need.  Check this source for an idea of how to get a handle on the page controls from AppBase

    -Tom

    Edit - in fact, here is some code I've used that removes the Unpublish button from the properties tab using jQuery & AppBase, might help get you started:

        public class RemoveUnpublishButton : ApplicationBase
        {

            public RemoveUnpublishButton()
            {
                umbracoPage.Load += new umbraco.presentation.masterpages.MasterPageLoadHandler(umbracoPage_Load);
            }

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

                if (page.Page.Request.Path.ToLower().Replace((GlobalSettings.Path + "/").ToLower(), "").Contains("editcontent.aspx"))
                {
                    var currentDocId = Convert.ToInt32(HttpContext.Current.Request.QueryString["id"]);
                    Document d = new Document(currentDocId);
                    if (d.ContentType.Alias == "QuizChoice" || d.ContentType.Alias == "QuizChoiceWithImage" || d.ContentType.Alias.StartsWith("Question-"))
                    {
                        string s = "<script type='text/javascript'>";
                        s += "$(document).ready(function() {";
                        s += "$('#body_UnPublishButton').hide();";
                        s += "});";
                        s += "</script>";
                        page.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "jshideunpublish", s);
                    }
                }
            }
        }
  • Giuseppe 34 posts 56 karma points
    Jan 10, 2012 @ 15:32
    Giuseppe
    0

    Thanks Tom, this is a great help for me!

    Have a good day

Please Sign in or register to post replies

Write your reply to:

Draft