简体   繁体   English

如何在Typo3中集成“自己的” HTML

[英]How to integrate “own” HTML in Typo3

I'm pretty new to TYPO3. 我是TYPO3的新手。 Just learned how to write a template with Fluid and integrate the Bootstrap Framework. 刚刚学习了如何使用Fluid编写模板并集成Bootstrap框架。 Somehow it worked. 它以某种方式起作用。 https://enkomp.com https://enkomp.com

But I really haven't understand, how I integrate my own HTML (from the template) into TYPO3 Maybe I learn it with another easy example - a sticky footer 但是我真的不明白,我如何将自己的HTML(从模板)集成到TYPO3中?也许我可以通过另一个简单的例子(粘性页脚)来学习它

I have put this into my template boottpl.html 我已将其放入模板boottpl.html

<footer class="footer">
  <div class="container">
    <p class="text-muted">Place sticky footer content here.</p>
  </div>
</footer>

But after loading it in my templatefolder (where the other template is stored AND works) the sticky footer doesn't show up in the frontend. 但是在将其加载到我的templatefolder(存储其他模板并正常工作)中之后,粘性页脚没有出现在前端。 Where do I need to place it? 我需要放在哪里?

You need to understand the usage of typoscript and the folder-structure of fluid. 您需要了解打字稿的用法和流体的文件夹结构。 And the usage of the word "template". 以及“模板”一词的用法。 In TYPO3 multiple items are called template: 在TYPO3中,多个项目称为模板:

  1. the records for typoscript 打字记录
  2. the prototypes for any kind of output (so HTML is preferred) 各种输出的原型(因此首选HTML)
    a. 一种。 (old) marker templates (旧)标记模板
    b. any fluid templates ( Layouts/ , Partials/ and Templates/ ) 任何流体模板( Layouts/Partials/Templates/
    c. C。 the fluid templates in the Templates/ folder Templates/文件夹中的流体模板

First you have to enhance the pathes to the fluid templates(b) which is defined in a typoscript template(a). 首先,您必须增强到打字模板(a)中定义的流体模板(b)的路径。

lib.fluidContent {  
   // use `lib.contentElement` for TYPO3 8
   templateRootPaths {
      200 = EXT:your_extension_key/Resources/Private/FSC/Templates/
   }
   partialRootPaths {
      200 = EXT:your_extension_key/Resources/Private/FSC/Partials/
   }
   layoutRootPaths {
      200 = EXT:your_extension_key/Resources/Private/FSC/Layouts/
   }
}

now for each template file(b) your folders are scanned first for a matching file and so your templates(b) can override the default ones. 现在,对于每个模板文件(b),将首先扫描文件夹中的匹配文件,因此您的模板(b)可以覆盖默认文件。

now you need to know the logic of template files(c): 现在您需要了解模板文件的逻辑(c):

Any call goes to a template file(c) located in the Templates/ folder. 任何调用都转到位于“ Templates/文件夹中的模板文件(c)。
That file can start with a <f:layout name="layoutname" /> tag. 该文件可以以<f:layout name="layoutname" />标记<f:layout name="layoutname" />
If that tag is given the rendering starts at the layout template(b) Layouts/layoutname.html . 如果提供了该标签,则渲染从布局模板(b) Layouts/layoutname.html
In that file you can call sections (by default from your template file(c)) and partials. 在该文件中,您可以调用部分(默认情况下从模板文件(c))和部分。
So you render your output with smaller blocks, you can use multiple times. 因此,您可以使用较小的块渲染输出,可以多次使用。

In this way you also can replace just one single block (eg partial) without the need to copy all template files(b). 这样,您也可以只替换一个块(例如,部分块),而无需复制所有模板文件(b)。

Thank you for answering @Riccardo Here't the code I put inside my setup.ts (stored under .../fileadmin/...: 感谢您的答复@Riccardo这不是我在setup.ts中存储的代码(存储在... / fileadmin / ...下:

page = PAGE
page {
10 = FLUIDTEMPLATE
10 {
    file = fileadmin/private/templates/boottpl.html
    partialRootPath = fileadmin/private/partials
    layoutRootPath = fileadmin/private/layouts

    variables {


    mitte < styles.content.get
    mitte.select.where = colPos=0


    }

}

includeCSS.bootmin = fileadmin/private/frameworks/bootstrap-3.3.7/css/bootstrap.min.css
includeCSS.boot = fileadmin/private/frameworks/bootstrap-3.3.7/css/bootstrap.css
includeCSS.startertemplate = fileadmin/private/styles/starter-template.css

includeJSFooter.jquery = fileadmin/private/frameworks/jquery-3.2.1.min.js
includeJSFooter.bootjs = fileadmin/private/frameworks/bootstrap-3.3.7/js/bootstrap.min.js
}

within my template .../boottpl.html I make the connection via section-tags: 在我的模板... / boottpl.html中,我通过section-tags建立连接:

<f:section name="content">        
    {mitte -> f:format.raw()}
</f:section>

Well it does work perfectly fine for the name="content" and name="navigation"...and I thought, that I've understood that process - but I couldn't manage it with the sticky footer 😕 好吧,对于name =“ content”和name =“ navigation”来说,它确实工作得很好……我想,我已经理解了该过程-但我无法通过页脚的粘性来管理它😕

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

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