2

我有一个插件http://typo3.org/extensions/repository/view/aw_consume

我将它用作它正在工作的内容元素

当我尝试分配给我的打字稿中的子部分时,什么都没有显示

LOGOUT < plugin.tx_awconsume.widgets.menu

这个插件是使用安装在 TYPO3 6.1.4 上的 extension_builder 扩展创建的

更新 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',

    )
);

我已经根据@lorenz 的回答更新了代码片段,但我仍然没有得到任何输出

我也推送了 TER 0.1.5 的最新版本

更新 4

只有在添加后我才设法获得预期的输出

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

从模板打字稿文件\typo3conf\ext\aw_consume\Configuration\TypoScript\setup.txt

它最初是由 extension_builder 扩展放置的,但是我觉得这不是一个好主意

4

1 回答 1

2

如果您仔细查看您的 ext_localconf.php,您会注意到您使用了供应商名称。供应商名称应以大写开头,因此您的ext_localconf.php应为:

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

您的ext_tables.php应如下所示:

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

插件的 TypoScript 对象应包含供应商名称(属性是 vendorName,而不是供应商):

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

请记住,您的类还必须包含供应商名称/使用正确的命名空间:

namespace Alexweb\AwConsume\Controller;

class ConsumerItemController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
}

那你应该没事。

扩展名是您的扩展键的 UpperCamelCase 变体,因此如果您的扩展键是“aw_consume”,那么您的扩展名就是“AwConsume”。这个名字在类中使用

插件名称是作为扩展一部分的特定插件的名称。由于扩展中可以有许多插件,因此您应该为其选择合适的名称。插件名称也应该是 UpperCamelCase。同一个控制器可以有多个插件,因此插件不必像控制器一样命名。

另请参阅http://forge.typo3.org/projects/typo3v4-mvc/wiki/FAQ#What-is-the-Extension-Name

于 2013-11-16T11:50:40.403 回答