简体   繁体   English

TYPO3 扩展中的模板

[英]Templates in TYPO3 extensions

I use TYPO3 v7.6.2!我用的是TYPO3 v7.6.2! Create a custom extension.创建自定义扩展。 As the controller can select a template to generate?作为控制器可以选择一个模板来生成? After the default, select the name_template = name_action.默认后,选择name_template = name_action。

Thank you, I found the answer to my question.谢谢,我找到了我的问题的答案。 In order to use different templates for the same extension, you just need to adjust the way in typoscript path to resources on the page where you need to.为了对同一个扩展使用不同的模板,你只需要在页面上你需要的资源的打字稿路径中调整方式。

Constants:常数:

plugin.tx_plugin {
  view {
    templateRootPath = fileadmin/tx_plugin/you_custom_template
    partialRootPath = fileadmin/tx_plugin/you_custom_partial
    layoutRootPath = fileadmin/tx_plugin/you_custom_layout
  }
}

and setup:并设置:

plugin.tx_plugin  {
  view {
    templateRootPaths.0 = {$plugin.tx_plugin.view.templateRootPath}
    partialRootPaths.0 = {$plugin.tx_plugin.view.partialRootPath}
    layoutRootPaths.0 = {$plugin.tx_plugin.view.layoutRootPath}
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM