简体   繁体   English

如何创建Typo3 bootstrap_package的自定义模板

[英]How to create custom template of Typo3 bootstrap_package

I am quite new in typo3. 我在typo3中很陌生。 I read somewhere 我在某处读书

You should never edit the original templates of an extension as those changes will vanish if you upgrade the extension

How to create my own custom template based on bootstrap_package extension? 如何基于bootstrap_package扩展名创建自己的自定义模板? I would like to override some files in parital/layout. 我想覆盖部分/布局中的文件。 It would be great if someone can post like/tutorial. 如果有人可以发布赞/教程,那就太好了。 A folder structure and a simple custom typoscript that implement bootstrap_package for my custom temple would be great help. 为我的自定义模板实现bootstrap_package的文件夹结构和一个简单的自定义打字稿将很有帮助。

The bootstrap package developers already added something for this. 引导程序包开发人员已经为此添加了一些东西。 It is possible to set different locations, where templates are stored. 可以设置存储模板的不同位置。 It also uses a fallback solution, that means if a template is not found, it will fetch the original one from the extension. 它还使用了一个后备解决方案,这意味着如果找不到模板,它将从扩展中获取原始模板。

Create a directory in the fileadmin directory, for example fileadmin/templates/BootstrapPackage . 在fileadmin目录中创建一个目录,例如fileadmin/templates/BootstrapPackage Inside this directory, create the directories "Templates", "Layouts" and "Partials". 在该目录内,创建目录“ Templates”,“ Layouts”和“ Partials”。

In TYPO3 backend, go to the constant editor of the root page and select everything like the screenshot says: 在TYPO3后端中,转到根页面的常量编辑器,然后选择所有内容,如屏幕截图所示: 在此处输入图片说明

Set the fields "Layout/Partial/Template Root Path" to your new created directorys (fileadmin/templates/BoostrapPackage/Layouts|Partials|Templates). 将字段“布局/部分/模板根路径”设置为新创建的目录(fileadmin / templates / BoostrapPackage / Layouts | Partials | Templates)。 Save and clear the cache. 保存并清除缓存。

Now you can create new templates. 现在您可以创建新模板。 If you place an exacly named file like it is named in bootstrap_package/Resources/Private/(Layouts/Partials/Templates)/Page/ , TYPO3 will use the new template instead. 如果您将一个完全命名的文件放置在bootstrap_package/Resources/Private/(Layouts/Partials/Templates)/Page/ ,则TYPO3将使用新模板。

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

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