Assign a plugin in typoscript

I have a http://typo3.org/extensions/repository/view/aw_consume plugin

I use it as a content item that it works

When I try to assign a subpage in my typoscript nothing is displayed

 LOGOUT < plugin.tx_awconsume.widgets.menu 

this plugin was created with extension_builder installed on TYPO3 6.1.4

update 3

 plugin.tx_awconsume { view { templateRootPath = {$plugin.tx_awconsume.view.templateRootPath} partialRootPath = {$plugin.tx_awconsume.view.partialRootPath} layoutRootPath = {$plugin.tx_awconsume.view.layoutRootPath} } persistence { storagePid = {$plugin.tx_awconsume.persistence.storagePid} } features { # uncomment the following line to enable the new Property Mapper. # rewrittenPropertyMapper = 1 } widgets { menu = USER menu { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run pluginName = FeAwConsume extensionName = AwConsume controller = ConsumerItem action = list vendorName = Alexweb } } } 

ext_tables.php

 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( $_EXTKEY, 'FeAwConsume', 'fe_awconsume' ); 

ext_localconf.php

 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Alexweb.' . $_EXTKEY, 'FeAwConsume', array( 'ConsumerItem' => 'list, show, new, create, delete', ), // non-cacheable actions array( 'ConsumerItem' => 'create, delete', ) ); 

I updated the code snippets according to @lorenz answer, but I still don't get the output

I also clicked the latest version in TER 0.1.5

update 4

I managed to get the expected result only after adding

 plugin.tx_awconsume.widgets { menu = USER menu { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run pluginName = FeAwConsume extensionName = AwConsume controller = ConsumerItem action = list vendorName = Alexweb } } 

To the typoscript file of the template from \typo3conf\ext\aw_consume\Configuration\TypoScript\setup.txt

If it was originally installed by extension_builder, however I got the feeling that this is not a good idea.

+1
source share
1 answer

If you look closely at your ext_localconf.php, you will notice that you are using the provider name. The provider name should start with Uppercase, so your ext_localconf.php should read:

 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Alexweb.' . $_EXTKEY, 'MyPlugin', array( 'ConsumerItem' => 'list, show, new, create, delete', ), array( 'ConsumerItem' => 'create, delete', ) ); 

Your ext_tables.php should look like this:

 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( $_EXTKEY, 'MyPlugin', 'Speaking name of my plugin' ); 

The TypoScript object of your plugin should include the name of the provider (the property is the name of the provider, not the provider):

  userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run pluginName = MyPlugin extensionName = AwConsume vendorName = Alexweb controller = ConsumerItem action = list 

Keep in mind that your classes should also include the provider name / use the correct namespace:

 namespace Alexweb\AwConsume\Controller; class ConsumerItemController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { } 

Then you should be fine.

The extension name is the UpperCamelCase variant of your extension key, so if your extension key is "aw_consume", your extension name is "AwConsume". This name is used in classes.

A plugin name is the name of a specific plugin that is part of your extension. Since there can be many plugins in an extension, you must choose a suitable name for it. The plugin name should also be UpperCamelCase. You can have several plugins for the same controllers, so the plugin should not be called as a controller.

See also http://forge.typo3.org/projects/typo3v4-mvc/wiki/FAQ#What-is-the-Extension-Name

+2
source

Source: https://habr.com/ru/post/1432556/


All Articles