I want to generate pages with a lot of data fairly automated. To do so, I looked into the blueprint function of umbraco. I am happy so far, but I cant reach the "Main Content" elements.
My Code so far:
I thought, i could access the "Main Content" elements via "GetPagedChildren" but I had no luck. The "childrens" are always 0 in count.
It looks like you are using a blocklist editor on the newly created page. If i understand correctly, you actually want all the items in blocklist editor and not the children (nested pages below the new page) of the new create page.
If you want to loop through all blocklist items, you can do something like this:
var blocks = request.Value<IEnumerable<BlockListItem>>("myBlocksProperty"); // probably something like 'mainContent'
foreach (var block in blocks)
{
var content = block.Content;
}
Get/Set/Edit "Main content" programatically
Hello there,
I want to generate pages with a lot of data fairly automated. To do so, I looked into the blueprint function of umbraco. I am happy so far, but I cant reach the "Main Content" elements.
My Code so far: I thought, i could access the "Main Content" elements via "GetPagedChildren" but I had no luck. The "childrens" are always 0 in count.
How can I access these elements?
Thanks in advance.
Hi Sydney,
It looks like you are using a blocklist editor on the newly created page. If i understand correctly, you actually want all the items in blocklist editor and not the children (nested pages below the new page) of the new create page.
If you want to loop through all blocklist items, you can do something like this:
Thank you very much Erik,
thats exacly what I needed!
is working on a reply...