This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Umbraco.Core.Models; | |
@using Umbraco.Core.Services; | |
var contentService = ApplicationContext.Current.Services.ContentService; | |
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService; | |
var contentType = contentTypeService.GetContentType(4200); | |
var content = contentService.GetById(2052); | |
content.ChangeContentType(contentType); | |
contentService.Save(content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Umbraco.Core.Models; | |
@using Umbraco.Core.Services; | |
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService; | |
var contentType = contentTypeService.GetContentType(4200); | |
contentType.ParentId=3130; | |
contentTypeService.Save(contentType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contentService = ApplicationContext.Current.Services.ContentService; | |
var content = contentService.GetById(1538); | |
//quick change lots of nodes template | |
var fileService = ApplicationContext.Current.Services.FileService; | |
var template = fileService.GetTemplate("CJ-Content"); | |
foreach(var item in content.Children()) | |
{ | |
item.Template = template; | |
contentService.Save(item); |