Copied to clipboard

Flag this post as spam?

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


  • Delete me 45 posts 66 karma points
    May 10, 2010 @ 17:16
    Delete me
    0

    Modify nodename in treeview only

    Hi all

    I have some nodes, where I want to add some extra information to the nodename in the treeview, without saving the change. I still want to be able to set the name stored in the database in the "name" field under the properties tab.

    I am able to change the nodename with doc.Text += "extra info" but this way the name field is allso modified.

    Is this possible?

    Thanks,

    Mathias

  • Chris Dunn 210 posts 401 karma points
    May 10, 2010 @ 21:43
    Chris Dunn
    0

    Mathias,

    Just to clarify, you want the node, when displayed in the content tree (backend) to display the nodename + "extra info".  Is the extra-info based on the specific document, document type etc?  If you want to customize the context menu of the content tree, here is some info to get you started:

    http://our.umbraco.org/wiki/reference/backoffice-apis/tree-api---to-create-custom-treesapplications

    There are also some videos on umbraco.tv to help.

    -Chris

  • Delete me 45 posts 66 karma points
    May 10, 2010 @ 22:19
    Delete me
    0

    Hi Chris

    Yes that is what I want. The "extra info" is just an "News date" value set by datepicker in every nodes.

    /Mathias

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 10, 2010 @ 22:32
    Dirk De Grave
    2

    I think you can also use the OnAfterNodeRender event to change the name that will be in the node tree. If used that way, you don't need to change or create existing/new sections just because the name of the node should be displayed differently.

     

    Hope this helps.

    Regards,

    /Dirk

  • Chris Dunn 210 posts 401 karma points
    May 10, 2010 @ 22:32
    Chris Dunn
    0

    Not sure why I said to update "context menu", probably thinking on something else.  But the link reference still applies.

    If you are storing news items, wouldn't it be better to store them in date folders, much like the blog for umbraco package?  Document would be self-describing base on the folder structure.  Might want to take a look.

    Also look at event handlers to append the date-picker value to the end of the document name on update or publish.  It would change the actual name and url though, but would be automatic.

    http://umbraco.org/documentation/books/api-cheatsheet/attaching-document-eventhandlers

    A few options.

    -Chris

     

  • Chris Dunn 210 posts 401 karma points
    May 10, 2010 @ 22:39
    Chris Dunn
    0

    Actually Dirks right, ignore my first link, I think i was a bit paste happy.  Monday's are hard :(

    Still look at the blog 4 umbraco package.  It might give you a different option for listing and storing your news items more efficently.

    Time to log off I think.

    -Chris

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 11, 2010 @ 00:33
    Aaron Powell
    0

    You can use either AfterNodeRender or BeforeNodeRender on the tree to do what you're wanting. I think those events exist in 4.0.x.

    4.1 also have before/ after TreeRender events so you can manipulate the whole tree in one foul swoop.

  • Delete me 45 posts 66 karma points
    May 18, 2010 @ 22:01
    Delete me
    0

    Hi again

    I am trying to set the xNode.Text with AfterNodeRender for childnodes under one specific parent. I can't figure out how to get a XmlTreeNode by its ID, and/or childXmlNodes under this parent. Anyone?

    /Mathias

Please Sign in or register to post replies

Write your reply to:

Draft