Copied to clipboard

Flag this post as spam?

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


  • Mounhim Tahtahi 41 posts 62 karma points
    Mar 28, 2012 @ 09:48
    Mounhim Tahtahi
    0

    Using the propertyeditor umbraco 5

    Hi,

    I am struggling in creating a custom property editor. I have taken the Child Content Property editor as the base for my property editor. The question I am having has popped up before, but I didnt find a satisfying answer. If I missed a post, my apologies upfront.

    Case: 

    There is a node called suppliers. Under that each node is a single supplier.

    There is another node called product. Each product  can be delivered only by one supplier.

    My solution:

    I took the child content property editor from the umbraco contrib project. In the file ChildContentEditor.cs I have removed the line: 

    HiveId currentHiveID = GetContentModelValue(x => x.Id, HiveId.Empty);

    since I dont want the children of the current node, but the children of another node.

    I then get the children of the other node with the following line as a starting point:

    var entity = uow.Repositories.Get<TypedEntity>(HiveId.Parse("content://p__nhibernate/v__guid/6b859a40e9de4720a72ea01d0102adc3"));

    As you can see, the parent node I am retrieving is hardcoded. Obviously I dont want that. 

    What I want is to have on the creation of the document type and adding this property to be able to select which page will be the parent page. And when creating the page having a dropdown with the subpages of this other node.

    Then I encounter a problem, because I want the first selection (selecting the parentnode) only to be made in the Document Type creation (in Settings) and the 2nd selection (selecting the childnode) only to be made in the content creation.

    As far as I can see, it is only possible to have one view. How do I distinct between the view for Document Type creation and a view for Content creation?

     

Please Sign in or register to post replies

Write your reply to:

Draft