Virtual Happy Hour is canceled this month (March) due to Good Friday.
Try our conversational search powered by Generative AI!
AI OnAI Off
Virtual Happy Hour is canceled this month (March) due to Good Friday.
Hi,
In your example, it looks like you're creating the block as a child of the articlePage where you should be creating it in that page's asset folder. The asset folder doesn't exist by default but you can get or create it as a single action like this:
var contentAssetHelper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();
var assetFolderLink = contentAssetHelper.GetOrCreateAssetFolder(articlePage.ContentLink).ContentLink;
You can then use assetFolderLink as the parent of your new block in your GetDefault() call.
Hi,
i'm trying to create content in a ContentArea of a page. I want to store this block in "for this page", as if the user would create it there manually.
But i get an exception "...is not allowed to be created under ArticlePage ..." at _contentRepository.Save. So how to do it correctly? This is my code: