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.
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); } } } }
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
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:
Thanks Tom, this is a great help for me!
Have a good day
is working on a reply...