我正在 TYPO3 中建立一个使用 AngularJS 的站点。为了在主体上获得正确的 CSS 类,我需要编辑 <body>
标签。我还想完全控制模板中的 HTML 输出。
我目前的尝试是使用从后端配置的模板:
page = PAGE
page.10 = TEMPLATE
page.10.template = FILE
page.10.template.file = fileadmin/Template/index.html
这将输出以下 HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2014 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at http://typo3.org/
-->
<title>My site - Title from Typo3</title>
<meta name="generator" content="TYPO3 6.2 CMS">
<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_8b9c2e8d89.css?1418032603" media="all">
</head>
<body>
<!-- HTML basics -->
<!-- My template start here -->
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie lt-ie9 lt-ie8 lt-ie7" ng-app="app"> <![endif]-->
<!--[if IE 7]> <html class="ie lt-ie9 lt-ie8" ng-app="app"> <![endif]-->
<!--[if IE 8]> <html class="ie lt-ie9" ng-app="app"> <![endif]-->
<!--[if gt IE 8]><!--> <html ng-app="app"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My site - Title from template</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" CONTENT="noindex, nofollow">
Templates guide in documentation不会告诉高级内容,例如将整个模板切换为其他内容。
- 我可以为此使用扩展吗?
- 我可以为我的模板创建扩展吗?
- 我的模板如何创建添加内容的 TYPO3 占位符?
我想将我的模板和 CSS/Javascript 放在存储库中,而不是在后端 GUI(数据库)中配置。
最佳答案
与其阅读入门指南
,不如尝试模板教程
:http://docs.typo3.org/typo3cms/TemplatingTutorial/
您可以将所有 TS 排除到文件中,并将其包含在一个模板记录中。这就是 Introduction Package
正在做的事情。
http://docs.typo3.org/typo3cms/TyposcriptSyntaxReference/Syntax/Includes/Index.html
关于html - 完全控制 TYPO3 的 HTML 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27358000/