Prompted by a conversation at: http://compositec1.codeplex.com/discussions/430310
Please could we have a new public function, that when you supply it with a PageId and PlaceHolderId, will output the HTML from the content block of another page?
This will allow users to duplicate content from one page/area of a website into another, without having to copy/paste every time the original page is edited.
Comments: ** Comment from web user: mawtex **
Please could we have a new public function, that when you supply it with a PageId and PlaceHolderId, will output the HTML from the content block of another page?
This will allow users to duplicate content from one page/area of a website into another, without having to copy/paste every time the original page is edited.
Comments: ** Comment from web user: mawtex **
I'll close this since it it trivial to create the feature - see thread https://compositec1.codeplex.com/discussions/430310, specifically this C# Function example by @burningice:
```
public XHtmlDocument GetContentFromPageAndPlaceHolder(Guid pageId, string placeholderId)�
{
using (var data = new DataConnection())
{
var placeholder = data.Get<IPagePlaceholderContent>().SingleOrDefault(c => c.PageId == pageId && c.PlaceHolderId = placeholderId);
if (placeholder != null)
{
return XHtmlDocument.Parse(placeholder.Content);
}
}
return null;
}
```