1
votes

Am using Umbraco 4.11.10

Is there a standard way to create a document type property which when updated, automatically syncs with the content node name?

I know this can be done in the Properties section in the Name field but that field cannot be moved from the properties tab and it is a little out of the way - users get confused.

How is this usually done?

Wing

1

1 Answers

0
votes

There are some special use umbraco field aliases. One is umbracoUrlName which will override the page url - just add it to your doctype and put it in whichever tab you want to change the url from.

EDIT

Another option would be to create a custom data type and use it to create a field that overwrites the node name. Add a text field as the UI of the custom data type; add an event that is fired whrn the textbox changes and update the name.

http://our.umbraco.org/wiki/reference/api-cheatsheet/modifying-document-properties

// Get the document by its ID
Document doc = new Document(node.Id);

// Get the properties you wish to modify by it's alias and set their value
// the value is saved in the database instantly!
doc.getProperty("name").Value = <input textbox value?;

// After modifying the document, prepare it for publishing
User author = User.GetUser(0); 
doc.Publish(author);

// Tell umbraco to publish the document so the updated properties are visible on website
umbraco.library.UpdateDocumentCache(doc.Id);