Skip to content

Instantly share code, notes, and snippets.

@aburok
Created March 25, 2015 09:45
Show Gist options
  • Save aburok/b29f2002c283dac0c61e to your computer and use it in GitHub Desktop.
Save aburok/b29f2002c283dac0c61e to your computer and use it in GitHub Desktop.
Adding block to content area programatically
GetBlocks(aboutPage.TopLeftContentBox)
.Select(block => new ContentAreaItem()
{
ContentLink = ((IContent)block).ContentLink
})
.ToList()
.ForEach(cai => aboutPage.AdditionalContent.Items.Add(cai));
_contentRepository.Save(aboutPage, SaveAction.Publish);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment