Try our conversational search powered by Generative AI!

Add Category to a page


I are having problem find out how programmatically add a category to a page.

Can anyone share some insight on how this is done?

Sep 19, 2014 13:52


You can do something like this

var category = new Category("Name", "Description");


var categories = CurrentPage.Category;


var page = CurrentPage.CreateWritableClone();
page.Category = categories;

ServiceLocator.Current.GetInstance().Save(page, SaveAction.Publish);
Sep 19, 2014 18:17

Thanks ;) made my monday

Sep 22, 2014 8:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.