Add this helper's in sfSimpleCMSHelper.php
function sf_simple_cms_to_slot($slot)
{
$inplace = sfContext::getInstance()->getRequest()->getParameter('inplace');
$edit = sfContext::getInstance()->getRequest()->getParameter('edit');
if($edit && $inplace){
return slot($slot);
}
elseif ($edit){
return '';
}
else {
return slot($slot);
}
}
function sf_simple_cms_end_to_slot()
{
$inplace = sfContext::getInstance()->getRequest()->getParameter('inplace');
$edit = sfContext::getInstance()->getRequest()->getParameter('edit');
if($edit && $inplace){
return end_slot();
}
elseif ($edit){
return '';
}
else {
return end_slot();
}
}
Usage example:
<?php use_helper('sfSimpleCMS','Partial', 'Cache', 'Form', 'I18N') ?>
<?php sf_simple_cms_to_slot('SLOT_NAME_IN_MODULE') ?>
<?php sf_simple_cms_slot($page, 'thx-page', '[cms_thx-msg]') ?>
<?php sf_simple_cms_end_to_slot(); ?>
<?php include_editor_tools($page) ?>
In edit mode if we add &inplace=true to the url we can edit the content of the slot right there where it is.