Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
<p>Hi!</p>
<p>I'm tearing my hair out over a block problem I've stumbled upon. I have a public form which creates new pages. These pages contain a contentarea where you can place images or slideshows (block). You can upload an image via the form and I would like to place the uploaded image inside the contentarea. Seemed like a rather easy thing to solve when I started out but I've found out it's not... </p> <p>The contentarea (Slideshow) can contain the blocktype SlideshowItem... SlideshowItem can contain an Image (contentreference). I've been thinking I could create some kind of local Slideshow block dynamically and then store the reference to the Image in that block. I wanna keep the contentarea and I don't wanna mess around with another kind of property (which I guess could solve my problem). I just can't figure this out... How would I go about doing this? I've been looking at http://joelabrahamsson.com/working-programmatically-with-local-blocks-in-episerver-7/ but it doesn't seem to work in my case. The page is not yet created so I can't create a local block for it programatically... I think!?</p>
<p>I kind of would like to do something like this (where ns holds the reference to the uploaded image):</p>
<p>newPage.Slideshow = contentRepository.Save(ns, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);</p>
<p>Thankful for any ideas on how to go about this!</p> <p></p>