本文介绍了TYPO3:找不到模板.视图无法解决,无法采取措施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用TYPO3后端模块,当我在后端的左侧菜单中单击我的模块时,我试图获取视图.但是,当我单击此按钮时,会收到以下消息:

I'm experimenting a bit with TYPO3 backend modules and I'm trying to get a view when I click my module in the left menu in the backend. However when I click this I get the following message:

我在Resources/Private/Backend/Templates/Connection文件夹中有list动作的视图,文件名为List.html(大写字母大写)

I have the view for the list action in the folder Resources/Private/Backend/Templates/Connection and the file is called List.html (uppercamelcase)

我正在使用TYPO3版本7.6.15,并使用扩展生成器制作了此模块.

I'm using TYPO3 version 7.6.15 and I made this module with the extension builder.

任何帮助将不胜感激.

推荐答案

此(或类似)错误的一些可能原因:

Some possible reasons for this (or similar) errors:

  1. 选择 WEB>模板模块(在模块"菜单中)
  2. 选择您的开始(根)页面(在页面树中)
  3. 选择信息/修改(在Docheader中)
  4. 选择编辑整个模板记录
  5. 选择标签包含
  6. 可用项目
  7. 下选择扩展程序
  1. Choose WEB > Template module (in Module menu)
  2. Select your start (root) page (in page tree)
  3. Select Info / Modify (in Docheader)
  4. Choose Edit the whole template record
  5. Choose tab Includes
  6. Select your extension under Available Items

这将在Configuration/TypoScript下激活TypoScript

This will activate the TypoScript under Configuration/TypoScript

通过TypoScript设置的模板路径必须与文件系统中可用的模板路径匹配.

The Template paths set via TypoScript must match the available template paths in the filesystem.

通常,默认路径为:

  • 资源/私有/模板(用于前端插件)

  • 资源/私有/后端/模板(用于后端模块)

必须通过TypoScript正确设置.例如:

This must have been set correctly via TypoScript. For example:

Configuration/TypoScript/setup.typoscript:

Configuration/TypoScript/setup.typoscript:

# Module configuration
module.tx_myexample_web_myexamplelist {
    view {
        templateRootPaths.0 = EXT:myexample/Resources/Private/Backend/Templates/
...  

  • 模块.用于后端模块
  • 如果您正在使用前端插件,请使用插件.而不是模块.
  • 以TypoScript结尾的正确文件是自TYPO3 8起的.typoscript ,不再是.ts或.txt.对于版本7,使用.ts是正确的.
    • module. is for backend modules
    • if you are working with frontend plugins, use plugin. instead of module.
    • the correct file ending for TypoScript is .typoscript since TYPO3 8 and no longer .ts or .txt. For version 7, it is correct to use .ts.
    • 确保Controller的名称与Templates目录中的子目录的名称匹配.模板文件的名称大写.

      Make sure that the name of the Controller matches the name of the subdirectory in the Templates directory. The name of the template file is capitalized.

      • Controller/SomeController.php:listAction()

      匹配

      • 资源/私人/后端/模板/某些/List.html

      定义TS的位置:

        如上所述.在Configuration/TypoScript setup.typoscript中(并通过static include加载).
      • 扩展根目录中的文件ext_typoscript_setup.typoscript可用于独立于页面树和模板记录来设置TypoScript.这将包含在所有TypoScript模板的设置部分中.但还要考虑文档.
      • 使用ExtensionManagementUtility中的功能直接在扩展中加载TypoScript或TypoScript文件
      • either as described above e.g. in Configuration/TypoScript setup.typoscript (and load this via static include).
      • The file ext_typoscript_setup.typoscript in the extension root can be used to setup TypoScript independent of page-tree and template-records. This will be included in the setup section of all TypoScript templates. but also consider the warning in the documentation.
      • Load TypoScript or TypoScript files directly in the extension with functions from ExtensionManagementUtility

      这篇关于TYPO3:找不到模板.视图无法解决,无法采取措施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 01:42