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.
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:
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.
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.
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?
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
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
Hi Chris
Yes that is what I want. The "extra info" is just an "News date" value set by datepicker in every nodes.
/Mathias
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
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
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
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.
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
is working on a reply...