[TYPO3-dev] Extbase: Extension for creating new CTypes

Raphael Weber mailinglisten at screensolutions.de
Fri Nov 21 11:20:16 CET 2014


Hi,

I've started developing a TYPO3 Extension (v6.2) to add Custom Content 
Elements based on tt_content.
I've already created the required folders/ files and configured the 
plugin by editing ext_emconf.php, ext_localconf.php and ext_tables.php. 
Recently I created the first controller class and tried to extend the 
Extbase class AbstractPlugin (like css_styled_content):

namespace Screensolutions\SsCustomCes\Controller;

use TYPO3\CMS\Core\Utility\GeneralUtility;

class ThumbnailteaserController extends 
\TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
}

Unfortuanetely this is producing following error message:

#1202921619: Invalid controller 
"Screensolutions\SsCustomCes\Controller\ThumbnailteaserController". The 
controller must implement the 
TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface.

Can you please explain me how I get this working or what´s the best 
practice to add custom ctypes?
My internet research to this topic sadly was not very successful; the 
only useful tutorial I found was this one, but it seems to be a little 
bit outdated:
http://bit.ly/11BrvV9

At the risk of the problem is not the controller, I paste the contents 
of the configuration files here:

ext_tables.php:

<?php
if (!defined('TYPO3_MODE')) {
	die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
	'Screensolutions.' . $_EXTKEY,
	'Thumbnailteaser',
	'Bootstrap Thumbnail Teaser'
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 
'Configuration/TypoScript', 'Custom CEs');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
         '<INCLUDE_TYPOSCRIPT: 
source="FILE:EXT:ss_custom_ces/Configuration/TypoScript/pageTsConfig.ts">'
);

$TCA['tt_content']['types']['sscustomces_thumbnailteaser']['showitem'] = 
$TCA['tt_content']['types']['textpic']['showitem'];

----------------------------------------------------------------------

ext_localconf.php:

<?php
if (!defined('TYPO3_MODE')) {
	die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
	'Screensolutions.' . $_EXTKEY,
	'Thumbnailteaser',
     array('Thumbnailteaser' => 'show'),
     array('Thumbnailteaser' => ''),
 
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

Hope you`ve got a solution for me!

kind regards,
	raphael



More information about the TYPO3-dev mailing list