The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
sender, EventArgs e)
Bootstrapper.Initialized += Bootstrapper_Initialized;
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
DynamicContent book = eventInfo.Item;
//The event is fired several times when an item is published though the backend so we need to get it exactly when it is being published
//And we also need only specific items - this time "Books"
&& book.GetType().ToString() ==
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type authorType = TypeResolutionService.ResolveType(
//Get ids of the related authors
var authors = book.GetValue<Guid>(
// This is how we get the authors DynamicContent items by their IDs
var authorItems = dynamicModuleManager.GetDataItems(authorType).Where(i => authors.Contains(i.Id));
// Now for every author item we update its books field with the new book if it is not present already
var books = author.GetValue<Guid>(
// This is where changes are persisted to the database. If you are having performance problems SaveChanges can be called once per several items.
Stoimen Stoimenov is Senior QA Engineer in Sitefinity Division. He is responsible for the overall quality of the product and leading various QA tasks in the team.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.