Closed xima-wla closed 3 years ago
I added a new drop zone like discribed in the manual. This new drop zone is available at the very bottom of all pages.
My code looks like this:
Typoscript:
page = PAGE
page.1001 = USER
page.1001 {
userFunc = Your\NameSpace\UserFunc\FrontendEditing->wrapWithDropZone
}
User function
<?php
namespace Your\NameSpace\UserFunc;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\FrontendEditing\Service\AccessService;
use TYPO3\CMS\FrontendEditing\Service\ContentEditableWrapperService;
class FrontendEditing {
/**
* @param string $content Empty string (no content to process)
* @param array $conf TypoScript configuration
* @return string $content
*/
public function wrapWithDropZone($content, $conf)
{
if (GeneralUtility::_GET('frontend_editing') && GeneralUtility::makeInstance(AccessService::class)->isEnabled()) {
$wrapperService = GeneralUtility::makeInstance(ContentEditableWrapperService::class);
$content = $wrapperService->wrapContentWithDropzone(
'tt_content', // table name of the record you want to create
0, // page uid where to store the new record (if set to 0 it will use the current page)
$content
);
}
return $content;
}
}
Hope this helps :-)
As this now have been documented and answered, closing issue.
Hi!
I cannot create new content elements on a blank page. Drag & drop is not working. I can just drag new content elements on a page where content elements already exist.
TYPO3 8.7.19 frontend_editing 1.3.7