\WikiPage
A page type that provides wiki like editing functionality. The initial goals are
- automatically create child pages based on [[page name]] style syntax
- be able to edit content via a wysiwyg mechanism
- add links by picking pages from the tree selection control
- add images picking images from the tree selection control
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
- License: BSD License (http://silverstripe.org/BSD-License)
Synopsis
class WikiPage
extends Page
{
- // members
- private static array $db = ;
- private static integer $lock_time = 60;
- public static boolean $auto_publish = true;
- public static boolean $show_edit_button = true;
- public static boolean $purify_output = false;
- protected static $registered_formatters;
- // methods
- public static void register_formatter()
- protected void onBeforeWrite()
- public void canEdit()
- public void getCMSFields()
- public void getEditorTypeOptions()
- public String getActualEditorType()
- public SimpleWikiFormatter getFormatter()
- public String ParsedContent()
- public void reformatShortcodes()
- public WikiPage getWikiRoot()
- public void lock()
- public void LinkPickerForm()
- public void ImagePickerForm()
Hierarchy
Extends
- Page
Members
private
- $db
- $lock_time
—
int
lock pages for 1 minute at a time by default
protected
- $registered_formatters
—
array
An array of plugins that allows developers to provide thirdparty field types
public
- $auto_publish
—
boolean
Set this to true in your mysite/_config.php file to force publishing as soon as you hit save. Removes the potentially awkward step of save/done/publish making pages seem to 'disappear'. Consider the situation where a user creates a new page link (while editing a page in stage), then publishes the edited page, which takes them to the newly published page; the page they created hasn't been published, so there's now a broken link. - $purify_output
—
boolean
Whether to run the content through HTMLPurify before we display it to users
Methods
protected
- onBeforeWrite() — Before writing, convert any page links to appropriate new, non-published, pages
public
- ImagePickerForm()
- LinkPickerForm()
- ParsedContent() — Retrieves the page's content, passed through any necessary parsing eg Wiki based content
- canEdit() — Returns whether or not the current user can edit this page
- getActualEditorType() — Return the editor type to use for this item. Will interrogate parents if needbe
- getCMSFields() — Get the CMS fields
- getEditorTypeOptions()
- getFormatter() — Gets the formatter for a given type. If none specified, gets the current formatter
- getWikiRoot() — Get the root of the wiki that this wiki page exists in
- lock() — Lock the page for the current user
- reformatShortcodes() — Reformats shortcodes after being run through htmlpurifier
- register_formatter() — Register a formatter