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

New Post: Reusing content from one web page in another

$
0
0

Don't get me wrong, but i don't quite follow your reasoning here. What makes you think that you can't go and use Composite.Core.Routing.PageUrls and Composite.Data.Types.IPagePlaceholderContent? Just because they are hidden from default intellisense in Visual Studio? There are plugins to turn that off.

Ie. for reusing content, just use this code

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

   returnnull;
}

Viewing all articles
Browse latest Browse all 2540

Trending Articles



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