Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Jul 17, 2009 @ 17:30
    trfletch
    0

    Adding property to node that shows its parent nodes

    Hi,

    I want to add a property to my document type that shows the nodes parent nodes, so basically if I have got a node called Testing sitting in the following structure:

    Summer 2008
       >Editorials
            >Poems
                >Testing

    I want a property that will show Summer\editorials\poems within Umbraco backend. You may wonder why I need this because I can see in the folder structure where the document sits in the content section but if I am using a search tool such as the Content Maintenance Dashboard http://our.umbraco.org/projects/content-maintenance-dashboard-package to find the node then I have no way of knowing where the node sits within the structure of my website. Any suggestions on this one?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 17, 2009 @ 17:37
    Dirk De Grave
    0

    Hi,

    Don't think adding a property would help a lot? A tool such as the content maintenance dashboard does not show that info, unless you fiddle around with the code. So, if you like to get full path to your content node, start customizing Richard's code to also show the complete path to the content node.

     

    Hope this helps.

     

    Regards,

    /Dirk

  • trfletch 598 posts 604 karma points
    Jul 17, 2009 @ 17:49
    trfletch
    0

    So I couldn't add some sort of custom property that will show the full path of a node? I know it wouldn't show in the content maintenance system but when I clicked on the node it would show?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 17, 2009 @ 19:07
    Dirk De Grave
    0

    I'm not sure whether I understand that last question? Maybe it's time to give us some insight on what to accomplish? Have a detailed use case scenario?

     

    Cheers,

    /Dirk

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 18, 2009 @ 00:59
    Aaron Powell
    0

    Document already has a Parent property which you can check recursively to find all the parents.

    I believe that Node has the same property as well, if not from Node you can use the Path property which is a comma separated string of the parent hierachy

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 11:16
    trfletch
    0

    What I am doing is creating a comments section using doc2form, when someone adds a comment on the website it creates an unpublished child node under the page for which the comment was left. I am going to use the content maintenance add-on so that the umbraco user can search for all unpublished comments within Umbraco and then approve them by publishing them, this will work fine but the only problem is when they view a comment they will have no idea what page the comment refers to hence it would be nice to have a property for the node that at the very least showed it full path so they know which page it was left on.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 20, 2009 @ 11:21
    Douglas Robar
    1

    I think the best solution would be to update Richard's package with a flag for 'show parent content'. The issue seems to be in the content maintenance package, not umbraco itself.

    I'd contact Richard and inquire about this. Or, since the code is available, make the change yourself.

    cheers,
    doug.

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 12:20
    trfletch
    0

    When the Umbraco user actually clicks on the node that is found by the content maintenance package then is shows the node in Umbraco so that you can edit it or publish it etc, I don't think this is part of the content maintenance package, the content maintenance package is just used to find the node in the first place therefore the change would need to be in umbraco. So if we forget the content maintenance package completely, is it possible to have a document type that has a property that shows the full path? i.e. when you click on the node in umbraco on the right hand side under one of the tabs there is a property that shows for example home > sub section > sub folder > articles

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 20, 2009 @ 13:11
    Douglas Robar
    0

    Well, there's the 'simple' way and the 'custom' way.

    The 'simple' way is to look at the Properties tab and you'll see the URL for the comment. Well, if the comment is published. Which is isn't at this point so that's a no-go in your specific scenario.

    The 'custom' way would be to add a property to the docType and populate it with the data you want to display to the umbraco user. This might be a textfield that contains a breadcrumb type path. Or possibly the bodyText of the parent. What makes this 'custom' is that you would populate it's value with an event handler triggered by the 'create' action.

    Make sense?

    cheers,
    doug.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 20, 2009 @ 13:36
    Peter Dijksterhuis
    0

    Maybe a dumb remark here, but if you edit a page, isn't the tree on the left-side reloaded with the complete path?

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 13:44
    trfletch
    0

    Hi Douglas,

    Yes the second option is exactly what I am looking for, the problem is I don't know how to create the custom property which is why I asked this question in the first place, I assume I will have to create a new Datatype but how I create one that lists the the url to the parent node is beyond me.

    Peter,

    No it doesn't seem to reload the node in the left hand side, I am using the content mainentance add-on to display the node in the first place so I am not looking for it through the content section.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 20, 2009 @ 13:53
    Peter Dijksterhuis
    0

    Ah, now I get it!

    You could fill that custom property using an event-handler perhaphs? Richard Soeteman did a nice article about that a while ago:

    http://www.richardsoeteman.net/CommentView,guid,f470b6cf-40da-4aa9-a0d9-7b984fe9bf59.aspx

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 20, 2009 @ 13:53
    Douglas Robar
    0

    I would add a docType property with the following settings:
    Name: Breadcrumb
    Alias: breadcrumb
    Type: Textstring

    I'd put the breadcrumb on its own tab so that it won't get displayed to visitors when you use Doc2Form.

    Then, you'd create an event handler that fires when this kind of docType (that is, the docType alias) is created. The event might simply show the niceUrl() of the parent node, for instance.

    Event handlers are pretty easy to create. Here are some links to get you started.
    http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events
    http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/event-examples
    http://umbraco.org/documentation/books/creating-and-using-an-action-handler (from umbraco v3, theories still apply)

     

    cheers,
    doug.

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 14:51
    trfletch
    0

    Thanks Peter and Douglas, I do not know ASP.net at all so I am going to struggle with this but I will give it a go. How do I find what the code is to show the niceUrl of the parent node? And also how do I make it output the result of that code to the new textstring document property I have created?

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 14:52
    trfletch
    0

    Thanks Peter and Douglas, I do not know ASP.net at all so I am going to struggle with this but I will give it a go. How do I find what the code is to show the niceUrl of the parent node? And also how do I make it output the result of that code to the new textstring document property I have created?

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 16:29
    trfletch
    0

    Ok, I have just found that if I add the Content Management add-on to the Content section by modifying dashboard.config then it does in fact do what Peter says and refreshs the left hand panel to show where the selected node is in the Content tree. This may be an easier solution for me to implement because it doesn't involve me trying to learn how to modify the source code in ASP.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 20, 2009 @ 16:42
    Peter Dijksterhuis
    0

    Cool! If that's a suitable solution, no need to get to learn .NET ;)

    Also, you would not need to give your users access to the Developer-section. The Content-section and media would be enough then, no chance of people 'accidentally' messing up the templates and stuff.

    Glad you figured it out!

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 17:12
    trfletch
    0

    I had actually created a new Umbraco section in the backend called Comments that I had added the Content Maintenance part to, it showed up on the right hand side and worked fine but of course on the left hand side there was nothing there except a folder that said [comments]. Ideally I would like to use this new section and have the Content tree show up on the left hand side and show the node that had been selected like it does when the Content Maintenance add-on is in the Content section, is there a simple way to do this, I assume I would need to copy whatever code etc makes the Content section work to my new Comments section then add the Content Maintenance part to the Comments section by modifying dashboard.config? So really I am asking how can I make a copy of the Content section? Where is the code I will need to copy to my Comments section to make it behave like the Content one?

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 20, 2009 @ 17:30
    Peter Dijksterhuis
    0

    You added that section by adding a row to the umbracoApp-table right? Not tried this, but you could try to fill the appInitWithTreeAlias with the same value as the content-section.

    If that doesn't work, you might need to add a row to the umbracoAppTree as well.

    As said, haven't tried this myself, but I think that's the place to start ;)

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 18:16
    trfletch
    0

    Hmm, can't seem to get any joy with this, I have tried adding the following to UmbracoApp:

    9commentscomments.gifIndholdcontent

    And I have added the following to UmbracoAppTree:

    TrueTrue9commentscommentsIndhold.sprTreeFolder.sprTreeFolder_oumbracoloadContentNULL

    But no joy, the comments section still shows only a folder called [comments] in the left hand pane. Also in the process I seem to have screwed up the Content section because that now just says Content with two sub folders called Content and does not show any of my pages (I even restored my database from Fridays backup but still can't get rid of this issue, very strange)!

  • trfletch 598 posts 604 karma points
    Jul 20, 2009 @ 18:37
    trfletch
    0

    Ok well I'm not quite sure how or why this has just happened but I just modified the Content Maintenance dll and resaved it to the bin folder (this was for a different reason, I was just trying to test modifying my first user control!) and now everything seems to work, the content section now shows the content and so does the comment section. Why would that have happened, did the new dll force the site to reload something which fixed everything???

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 20, 2009 @ 19:01
    Peter Dijksterhuis
    0

    That probably forced an application-restart which caused the tables to be loaded from the DB again. Didn't know that was necessary, but glad it worked :)

  • trfletch 598 posts 604 karma points
    Jul 21, 2009 @ 10:52
    trfletch
    0

    Ok well thank you for all your help, I now have it working how I want, just to clarify I have created a new section in the Umbraco backend that is called Comments, this section is a copy of the Content section but I have added a modified version of the Content Maintenance add-on to the right hand side, the modified version searchs for any nodes that have a document type of "Comment" and are unpublished (my comments doc2form creates a comment but does not publish it). You can then click on one of the comments and the left hand pane will refresh to show where the node sits in the content tree, the user can then publish the comment if they approve of it and click back on the Comments section to once again show the list of unpublished comments.

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jul 22, 2009 @ 06:51
    Richard Soeteman
    0

    @Doug A breadcrump datatype, what a great Idea :).

    @Peter. The tree isn't updated all the time. I think 4.1 will solve that issue.

    @All I will update the content maintenance package with some extra functionality like moving and filter by node options, so you can filter by a certain parent. The first version was just helping me delete nodes that I've imported using umbImport.

    Cheers,

    Richard 

  • michel jones 2 posts 22 karma points
    May 31, 2012 @ 10:36
    michel jones
    0

    Can anyone suggest to me about moorpark property management because all  of you are talking about property and all that.if anyone suggest me about this property type then i would be much pleased of them.

Please Sign in or register to post replies

Write your reply to:

Draft