2013-11-26 43 views
1

現在用一把umbraco 4.11.10一把umbraco - 自動同步內容節點名稱與

有沒有創造出更新,當一個文檔類型物業的標準方式文檔類型屬性,自動與內容節點名稱同步?

我知道這可以在名稱字段屬性部分進行,但該字段不能從屬性選項卡中移動,這是一個有點出的方式 - 用戶感到困惑。

這通常如何完成?

Wing

回答

0

還有一些特殊用途的umbraco字段別名。一是umbracoUrlName這將覆蓋網頁的網址 - 只需將其添加到您的文檔類型,並把它放在你想改變的網址爲準標籤。

編輯

另一種選擇是創建一個自定義的數據類型,並用它來創建一個覆蓋節點名稱的字段。添加一個文本字段作爲自定義數據類型的UI;添加文本框更改並更新名稱時觸發的事件。

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); 
+0

這並不與內容節點名稱同步雖然。是否有另一個字段別名呢? – wingyip

+0

沒有特殊的內置字段可自動更改頁面名稱 – amelvin