TYPO3 Extbase后端模块TypoScript for Fluid布局未加载

时间:2016-05-06 21:30:57

标签: typo3 typoscript extbase typo3-6.2.x typo3-extensions

在TYPO3 CMS 6.2.17中,我使用Extension Builder创建了一个具有前端插件和后端模块的Extbase扩展。我构建了一个包含两个页面的localhost网站:id = 1是标准页面;和id = 2是一个文件夹。标准页面包含站点的根TypoScript模板,该模板包含我的扩展的静态文件。

我在Web模块中激活了我的Extbase扩展。当我选择我的扩展名和文件夹页面(id = 2)时,我看到了默认控制器和操作的填充列表显示;但显示器使用的是前端Fluid布局,而不是后端布局。我想在“typo3-docheader-functions”div类中使用Fluid actionMenu的后端布局。

我似乎无法获得显示器的后端Fluid布局。我已经选择了标准页面(按预期显示空列表显示)甚至是站点根页面(id = 0)(也是空列表显示),但它们也都使用了前端Fluid布局。

我已清除所有缓存并清除了安装工具中的typo3temp /。我已在Extension Manager中停用并重新激活了我的扩展程序。我尝试了TYPO3 Extbase backend module. Template path issue甚至TYPO3 4.5 extbase test backend module中建议的解决方案。到目前为止,没有任何工作。我甚至已经浏览了网站的安装工具“所有配置”设置,但看不到任何我认为会影响后端显示问题的内容。

代码直接来自Extension Builder,但这里有一些摘录。

ext_tables.php:

if (TYPO3_MODE === 'BE') {

    /**
     * Registers a Backend Module
     */
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
        'MyVendor.' . $_EXTKEY,
        'web',
        'myextbe',  // Submodule key
        '',                     // Position
        array(
            'Import' => 'list, show, new, create, edit, update, delete',
            'Pages' => 'list, show',
        ),
        array(
            'access' => 'user,group',
            'icon'   => 'EXT:' . $_EXTKEY . '/ext_icon.gif',
            'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_myextbe.xlf',
        )
    );

}

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

myext \配置\的TypoScript \ constants.txt:

module.tx_myext_myextbe {
    view {
        # cat=module.tx_myext_myextbe/file; type=string; label=Path to template root (BE)
        templateRootPath = EXT:myext/Resources/Private/Backend/Templates/
        # cat=module.tx_myext_myextbe/file; type=string; label=Path to template partials (BE)
        partialRootPath = EXT:myext/Resources/Private/Backend/Partials/
        # cat=module.tx_myext_myextbe/file; type=string; label=Path to template layouts (BE)
        layoutRootPath = EXT:myext/Resources/Private/Backend/Layouts/
    }
    persistence {
        # cat=module.tx_myext_myextbe//a; type=string; label=Default storage PID
        storagePid =2
    }
}

myext \配置\的TypoScript \ SETUP.TXT:

 # Module configuration
module.tx_myext_myextbe {
    persistence {
        storagePid = {$module.tx_myext_myextbe.persistence.storagePid}
    }
    view {
        templateRootPath = {$module.tx_myext_myextbe.view.templateRootPath}
        partialRootPath = {$module.tx_myext_myextbe.view.partialRootPath}
        layoutRootPath = {$module.tx_myext_myextbe.view.layoutRootPath}
    }
}

1 个答案:

答案 0 :(得分:4)

将所有module.tx_myext_myextbe替换为module.tx_myext,将plugin.tx_myext_myextfe替换为plugin.tx_myext

module.tx_myext_myextbe在6.2.x中是无效的表示法 - 在结果中Extbase找不到它并尝试默认的模板路径,即前端一个

<强> constants.txt

module.tx_myext {
    view {
        # cat=module.tx_myext/file; type=string; label=Path to template root (BE)
        templateRootPath = EXT:myext/Resources/Private/Backend/Templates/
        # cat=module.tx_myext/file; type=string; label=Path to template partials (BE)
        partialRootPath = EXT:myext/Resources/Private/Backend/Partials/
        # cat=module.tx_myext/file; type=string; label=Path to template layouts (BE)
        layoutRootPath = EXT:myext/Resources/Private/Backend/Layouts/
    }
    persistence {
        # cat=module.tx_myext//a; type=string; label=Default storage PID
        storagePid = 2
    }
}

<强> SETUP.TXT

module.tx_myext {
    persistence {
        storagePid = {$module.tx_myext.persistence.storagePid}
    }
    view {
        templateRootPath = {$module.tx_myext.view.templateRootPath}
        partialRootPath = {$module.tx_myext.view.partialRootPath}
        layoutRootPath = {$module.tx_myext.view.layoutRootPath}
    }
}

TypoScript对象浏览器

[module]
  [tx_myext]
   [view]
    [templateRootPath] = EXT:myext/Resources/Private/Backend/Templates/
    [partialRootPath] = EXT:myext/Resources/Private/Backend/Partials/
    [layoutRootPath] = EXT:myext/Resources/Private/Backend/Layouts/