Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:webedition:beginners-guide:main-template

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
en:webedition:beginners-guide:main-template [2019/02/09 21:35]
Sascha Nemecek
— (aktuell)
Zeile 1: Zeile 1:
-====== Main Template and Subtemplate ======== 
  
-In the previous step, we created a rather simple page with a header, a date and a textfield. Most pages require more complex structures, and you'll find yourself creating all kinds of template types. 
-If you always create a full HTML template with header etc., changes to the global layout of your website become unmanageable. 
-To avoid this, webEdition has the concept of main and sub-templates:​ The main template contains the code that remains identical for all site's pages, while sub-templates are injected into the main template. 
- 
-===== The Main Template ==== 
- 
-<code html> 
-<​!doctype html> 
-<html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​ 
-<​head>​ 
-    <​we:​charset defined="​UTF-8">​UTF-8</​we:​charset>​ 
-    <meta name="​viewport"​ content="​width=device-width,​ user-scalable=no,​ initial-scale=1.0,​ maximum-scale=1.0,​ minimum-scale=1.0">​ 
-    <meta http-equiv="​X-UA-Compatible"​ content="​ie=edge">​ 
-    <​we:​title></​we:​title>​ 
-    <​we:​description></​we:​description>​ 
-    <​we:​keywords></​we:​keywords>​ 
-    <we:css id="​123"​ comment="​inserts a css-stylesheet with the WE-ID 123" /> 
-    <we:js id="​124"​ comment="​inserts a javascript with the WE-ID 124" /> 
-</​head>​ 
-<​body>​ 
- 
-    <​we:​content /> 
- 
-</​body>​ 
-</​html>​ 
-</​code>​ 
- 
-Save this template as main.tmpl (for example). In place of ''<​we:​content />'',​ the contents of the sub-template are injected. <​note>​Whenever you change the main template now, webEdition asks you whether it should rebuild the child templates.</​note>​ 
- 
-If you need to fill **multiple sections** in the page, use the ''<​we:​master>''​- and ''<​we:​content>''​-tag:​ 
- 
-//​main.tmpl://​ 
-<code html> 
-<​we:​content name="​preheader"/><​!doctype html> 
-<html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​ 
-<​head>​ 
-    <​we:​content name="​html_header"/>​ 
-</​head>​ 
-<​body>​ 
- 
-    <​we:​content /> 
- 
-    <​we:​content name="​body_end"/>​ 
- 
-</​body>​ 
-</​html>​ 
-</​code>​ 
- 
-==== The Subtemplate ==== 
- 
-//​page.tmpl://​ 
-<code html> 
-<!-- This is displayed in we:content --> 
-Whatever 
-<!-- // This is displayed in we:content --> 
- 
-<!-- These are displayed in  the we:​content-sections with names --> 
-<​we:​master name="​preheader"><?​php // You could set a http-Header here! ?></​we:​master>​ 
-<​we:​master name="​html_header">​ 
-    <​style>​ 
-        /* Set individual CSS-Styles for this template only! */ 
-    </​style>​ 
-</​we:​master>​ 
-<​we:​master name="​body_end">​ 
-    <​script>​ 
-        /* This JavaScript is only included in this template ​ */ 
-    </​script>​ 
-</​we:​master>​ 
- 
-</​code>​ 
- 
-Whenever you create a new template, you just define the master template under "​Properties"​. 
en/webedition/beginners-guide/main-template.1549744522.txt.bz2 · Zuletzt geändert: 2019/02/09 21:35 von Sascha Nemecek

Recent changes RSS feed