我正在使用sitecore Api创建和更新项目,我的要求是仅在Sitecore9.0.2中使用Sitecore API更新项目的templateid
First you need to find the template by it's path path after /sitecore/template
, so for /sitecore/templates/common/folder
template, you would need to write:
var yourNewTemplate = item.Database.Templates["common/folder"];
And then you just call ChangeTemplate
method on your Sitecore item, eg:
item.ChangeTemplate(yourNewTemplate);
I do not think there is any such api available which can change the template however you can edit an item using OData sitecore apis but it does not accept any such parameter which can modify it's template.
Edit An Item
URL
/item/{id}?database&language&version
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.