Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm trying to reorder siblings when a content node is saved based on a a date property type. Anyone got any ideas?
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { ContentService.Saved += ISaving; } private void ISaving(IContentService sender, Umbraco.Core.Events.SaveEventArgs<Umbraco.Core.Models.IContent> e) { var IPages = e.SavedEntities.Where(x => x.ContentType.Alias == "IPage"); if (IPages .Count() > 0) { foreach (var page in IPages ) { try { if (!page.HasProperty("publishedDate") || page.GetValue<DateTime>("publishedDate") != null) { page.SetValue("publishedDate", page.CreateDate); } sender.GetParent(page.Id).SortOrder = ????? } catch (Exception ex) { LogHelper.Info(this.GetType(), ex.Message.ToString()); } } } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Change SortOrder on Saving Event
Hi,
I'm trying to reorder siblings when a content node is saved based on a a date property type. Anyone got any ideas?
is working on a reply...