简体   繁体   English

在Typo3中创建新的页面模板

[英]Creating a new page template in Typo3

I'm using Typo3 for the first time and have been asked to update a site built on it. 我是第一次使用Typo3,并被要求更新基于它的网站。

Making changes to existing templates so far has been OK since they were mainly CSS changes or replacing images. 到目前为止,对现有模板进行更改是可以的,因为它们主要是CSS更改或替换图像。 Now though I need to create a couple of new page templates. 现在,尽管我需要创建几个新的页面模板。

What's the easiest way to go about this? 最简单的方法是什么? The existing site has a home.html and layout.hmlt in the fileadmin directory. 现有站点在fileadmin目录中具有home.html和layout.hmlt。 Do I need to create a new html file there, if so how do I use this as a new template for some of my pages? 我是否需要在其中创建一个新的html文件,如果是的话,如何将其用作某些页面的新模板?

I'm coming from a mainly WordPress background in terms of CMS (I've nearly given in a recoded the site as a WordPress site since I think it would be quicker at this stage) but I'd really prefer to figure this out. 我来自CMS方面的主要是WordPress背景(由于我认为在现阶段会更快,因此我几乎将其重新编码为WordPress网站中已经给出了),但我真的更想弄清楚这一点。

Any suggestions would be greatly appreciated as I'm pulling my hair out trying to read through the documentation and getting nowhere. 任何建议都将不胜感激,因为我正努力阅读文档,却一无所获。 The site is using Typo3 version 4.4.6 该站点正在使用Typo3版本4.4.6

Thanks! 谢谢!

How you add a new template to your page depends on how templating is handled. 如何向页面添加新模板取决于模板的处理方式。 Sadly TYPO3 has a poor templating out of the box, so there is most likely an extension that does the job on your site. 遗憾的是TYPO3的模板开箱即用,因此很可能有一个扩展程序可以在您的网站上完成工作。

Probably one of these: 可能是其中之一:

  • automaketemplate 自动制作模板
  • templa_voila templa_voila
  • flux & fluidpages 通量和流体页面

Check if one of these extension is installed and add a new page template according to the extensions manual or specify your question afterwards. 检查是否安装了这些扩展程序之一,并根据扩展程序手册添加新的页面模板,或在以后指定您的问题。

Edit: If plain TYPO3 was used, you'll find something like 编辑:如果使用普通的TYPO3,您会发现类似

page = PAGE
page.10 = TEMPLATE
page.10 {
  file = fileadmin/myTemplate.html
}

in your Typoscript. 在您的打字稿中。 You can add tmplate files like the ones that are already there. 您可以添加tmplate文件,例如已经存在的文件。 To use a different template on a page, you have to replace the page.10.file with the template you want to use. 要在页面上使用其他模板,必须将page.10.file替换为page.10.file使用的模板。 This can be done with a new template record (crated in backend via the template module). 这可以通过新的模板记录来完成(通过模板模块在后台加载)。 But this is a rather anoying procedure to change the template, because you have to create each time you want to change the page template for a page and its children. 但这是一个相当麻烦的更改模板的过程,因为每次要更改页面及其子页面的模板时,都必须创建。 That is why mostly extensions are used for this. 这就是为什么大多数扩展用于此目的。

The out of the box situation gets better with newer TYPO3 versions but in 4.4.6 there are no Backend Layouts that could be uses for a template switch ot something like that. 较新的TYPO3版本开箱即用的情况会更好,但是在4.4.6中,没有后端布局可用于类似这样的模板切换。

In Addition to change the mere file you have to adjust the subparts or marker that are filled with the content. 另外,要更改纯文件,您还必须调整填充内容的子部分或标记。 You'll find that configured in your TypoScript as well 您还会在TypoScript中找到配置的内容

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

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