Hi David,
here is how you can use Pauli's code way without using Visual Studio:
- On the Functions perspective, C# Functions execute the "Add Inline C# Function" command
- In the dialog name it GetPageContent - set namespace to MyTools. Click OK
- Paste in the C# code shown below in the "Source" tab (delete what is there already)
- On the Input Parameters tab, create to items:
- "Page" of type DataReference<C1 Page>
- "Placeholder" of type string
- Save.
- Tnsert your function on a page or call it from an XSLT and you should see your content show up :)
You can change both namespace and function name - just remember to do so in both the source code and the Settings tab - they need to match up.
using System;using System.Linq;using Composite.Core.Xml;using Composite.Data;using Composite.Data.Types;namespace MyTools {publicstaticclass InlineMethodFunction {publicstatic XhtmlDocument GetPageContent(DataReference<IPage> Page, string Placeholder) {using (DataConnection dc = new DataConnection()) { Guid pageId = (Guid)Page.KeyValue;var placeholder = dc.Get<IPagePlaceholderContent>().SingleOrDefault( f=> f.PageId == pageId && f.PlaceHolderId == Placeholder );return (placeholder == null ? null : XhtmlDocument.Parse( placeholder.Content )); } } } }