I have a feed that I would like to pass the HTML markup from a specific contentArea of a News article page. At the moment I get the Pagedata of all the article pages via a webservice but I need to get the markup from an ExtensionContentArea by Id per article page.
Is this possible and if so how is it done?
Is this at all possible?
You can read more about custom rendering blocks from content area here
It's possible but normally cheaper to take gui developer in the ear to make html match the standard with containing tags etc / use multiple content areas...
Im sorry but Im not sure what you mean.
Basically I am using a search such as:
var pages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criterias, lang.LanguageBranch);
and I need to loop the pages to get the content from this control:
<Extension:ExtensionContentArea ID="ContentMain" Description="Main Content Area" runat="server"></Extension:ExtensionContentArea>
Is this possible?
Also, the language branch doesnt seem to bring back the correct URLs to the page - they are still in the default english lanuage.
I have found this link:
BUT - on line 6 it is using Page - which im not sure how I can use this - as I am running this feed as an RSS feed in an ashx using FindPagesWithCriteria
Can anyone help?
Sorry. Noticed the version too late :) ignore my previous comment...
For everyone who wants to know this is how I did it:
public string GetContentFromCompaoserBlock(PageData child)
string output = "";
var structure = PageDataManager.LoadPageStruct(child.PageLink);
var contentArea = structure.GetContentAreaById("ContentMain");
ExtensionPageData page = ExtensionPageData.Load(child.PageLink);
if (page != null && page.AreaCount > 0)
List<ContentFunctionData> functions = page.GetAllContentFunctions(true);
if (functions.Count > 0)
foreach (var item in functions)
ContentFunctionReference cfr = new ContentFunctionReference(item.FunctionID, item.WorkID);
PageData pdCurrent = EPiServer.DataFactory.Instance.GetPage(cfr);
if (pdCurrent.PageTypeName == "[ExtensionSys] Text")
output += pdCurrent.Property["Content"].ToString();
output = "NOTHING";
catch (Exception ex)