Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A module to allow free editing of pages on the frontend of websites ssau-module

branch: master
README.md

Frontend Editing Module

Maintainer Contact

Marcus Nyeholt

Requirements

SilverStripe 2.4.x

Documentation

The frontend editing module adds the ability to edit HTML based content on the frontend of your website. Developers specify in their templates the fields they want to be able to edit, add an include for buttons to help with switching between edit and standard views, and that's all there is to it.

Add the following to your _config.php for the pages you want editable

DataObject::add_extension('Page', 'FrontendEditableExtension');

DataObject::add_extension('Page', 'FrontendLockable');

In your templates, add the following in place of raw output fields - for example, instead of $Content, you use

$EditableField(Content)

As well as single fields of the current page, you can use it on other objects contained in a control block (so long as those objects have the EditableExtension)

<ul>
<% control Items %>
    <li>$EditableControl(Title)</li>
<% end_control %>
</ul>

Also in your template, add the following at the top. It includes some controls for initiating the editor (if you want them). You can provide your own mechanism for launching the editor, but this is simpler :)

<% include FrontendEditingControls %>

API

Defining new plugins for the editor

Troubleshooting

Something went wrong with that request. Please try again.