Content Editor Page
Content templates consist of two elements:
- Renderers (Apex class)
- Content Editor Page (Visualforce Page)
The typical framework of a content editor page used by content authors to create and edit content contains:
- An array populated with the names and values of each of the attributes entered by the content author
- HTML form fields and jQuery widgets for the content author to enter values for the attributes
- A save function that is used by OrchestraCMS to write the attributes in the array as records in Salesforce
- A function to disable the inputs if the content should be locked for editing (e.g. published, locked, no permission, expired, etc.)
A simple example of a content editor is shown below.
<apex:page controller="cms.CreateContentController" extensions="SampleContentTemplate" showHeader="false" sidebar="false" cache="false" standardStylesheets="false">
<apex:outputPanel layout="block">
<script type="text/javascript">
$(document).ready(function() {
ce.content_editor('registerSaveFunction', function() {
return [
{
name: "myAttr",
value: $('#myField').val(),
type: "Text",
}
];
});
});
</script>
My Attribute: <input id="myField" type="text" value="{!myAttr}"/>
</apex:outputPanel>
</apex:page>
The content editor page must have the controller set to cms.CreateContentController. It must be extended by the class that contains your accessors.