search
AI OnAI Off
var rep = ServiceLocator.Current.GetInstance
Just writing from memory here so could be a bug or two in there. But something like it. =)
Thanks Petter. But it seems ContentArea.Items.Add() expects a ContentAreaItem object?
clone.MainContentArea.Items.Add(new ContentAreaItem()
{
ContentLink = myReference
});
There is a forum post with similar code that you could use: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=86474
Thanks a bunch!
Here's what I ended up with:
var writableClonePage = (LandingPage)CurrentPage.CreateWritableClone();
var rep = ServiceLocator.Current.GetInstance
NP.
In case you would rather use the "for this page" folder, you could simply add:
var contentAssetHelper = ServiceLocator.Current.GetInstance
Is it possible to programmatically add blocks to a page?
I would assume that you would have to to something like this