Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

Commented Feature: Feature Request: New function for content reuse [1580]

$
0
0
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 **

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;
}
```


Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>