I am a beginner regarding EPiServer. We use EPiServer Version 9.12. EPiServer.Core.ContentArea had a Contents list in the past which is now obsolete, see: http://world.episerver.com/documentation/Class-library/?documentId=cms/7.5/284B326A
image http://jweschenfelder.de/download/Untitled.png
The Contents list had the advantage in the past that you could read the name of the block because it read the full content of the ContentArea. It would be great to retrieve the name since you can configure it inside the CMS if you create a new block there. If I use the now suggested Items collection instead, I am not able to read the name of the block which contains the Link items collection, I am only able to read the Link items collection inside of the block then.
I have seen the example:
IContentLoader contentLoader = ServiceLocator.Current.GetInstance< IContentLoader >();
OnSiteLinkBlock itemBlock = contentLoader.Get(item.ContentLink, new LoaderOptions() { LanguageLoaderOption.MasterLanguage() });
I am able to edit OnSiteLinkBlock, but additional properties remain null and are not filled by the ContentLoader of the EPiServer (IContentLoader is an interface of EPiServer).
More info about the class hierarchy:
- [AvailableContentTypes(Availability = Availability.None)]
(in EPiServer.Core)
public class BlockData : ContentData, IReadOnly< BlockData >, IReadOnly
- public abstract class BlockBase : BlockData
(BlockBase is an own class)
- public class OnSiteLinkBlock : BlockBase
(OnSiteLinkBlock is an own class)
Does someone know a solution here? How can I read more properties of the ContentArea? Or does exist an alternative for ContentArea? Many thanks!
Typically you use the
Items
orFilteredItems
properties to read contents from ContentAreas. They return an enumerable of ContentAreaItem's.Resolve the IContent instance using an
IContentLoader
and feed it with theContentLink