London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi,
You can do something like this
var category = new Category("Name", "Description");
Category.GetRoot().Categories.Add(category);
var categories = CurrentPage.Category;
categories.Add(category.ID);
var page = CurrentPage.CreateWritableClone();
page.Category = categories;
ServiceLocator.Current.GetInstance().Save(page, SaveAction.Publish);
I are having problem find out how programmatically add a category to a page.
Can anyone share some insight on how this is done?