public function render($format, Doku_Renderer $renderer, $data) {
$class = '';
// Add section edit infos only in XHTML renderers which are
// sufficiently new
if ($format === 'xhtml' && method_exists($renderer, 'startSectionEdit')) {
// Prepare section edit data in a backwards compatible way.
// FIXME: Insert plugin name here as 'target' (previously section type)
$sectionEditData = ['target' => 'plugin_exampleplugin'];
if (!defined('SEC_EDIT_PATTERN')) {
// backwards-compatibility for Frusterick Manners (2017-02-19)
$sectionEditData = 'plugin_exampleplugin';
}
/* @var Doku_Renderer_xhtml $renderer */
$class = $renderer->startSectionEdit($data['bytepos_start'],
$sectionEditData);
}
$renderer->doc .= '';
// FIXME: Put your content here
$renderer->doc .= '
';
// Add section edit infos only in XHTML renderers which are
// sufficiently new
if ($format === 'xhtml' &&
method_exists($renderer, 'finishSectionEdit')) {
/* @var Doku_Renderer_xhtml $renderer */
$renderer->finishSectionEdit($data['bytepos_end']);
}
}
If the section of your plugin has a distinguishable name, you may add it to the method call as well. In this case the old and new method signatures are to different to achieve backwards compatibility by just assigning different values to ''$sectionEditData''. It requires two different method calls: