First I would recommend that you use the same names for your heading, ingress and image.
When you say "image in block on the page", do you mean the page that contains the Content Area?
Otherwise, rendering pages and blocks are standard functionality in EPiServer and how to do it is about the same.
Are you using MVC och WebForms?
Here is an article describing the basics of rendering content in EPiServer:
http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2012/9/EPiServer-7--Rendering-of-content/
Ted also has a good blog post but it's based on MVC
http://tedgustaf.com/blog/2013/10/how-to-render-pages-in-a-content-area/
Hi Alf,
Image in block on page means if there are 4 blocks in page dragged and dropped, then by looping in blocks to find image from the blocks.
Using MVC.
Thanks I will refer all these links.
Ah I think i see, so "shall" tries to pick an image added to the XHTML string from "ingress" while "should" use the image property as a fallback?
Shall: Use first image from body text means to find image from body text of a page
Should: If no image in body text, look for image in block on the page. means if no image found in body text, then loop from the blocks dragged on page and find first image from it.
Also I managed to do this, by creating a rendered by partial view :) and managed to get text properties.
Now will loop thru the blocks for images if no image found in body text of a page.
Hi,
Requirement is:
i. heading 1
ii. ingress
iii. image.
Shall: Use first image from body text
Should: If no image in body text, look for image in block on the page.
So after publish, need to render pages and block with the properties mentioned above.