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/08 11:34]
Rudolf Horbas [The Subtemplate]
en:webedition:beginners-guide:main-template [2019/02/09 21:35] (aktuell)
Sascha Nemecek
Zeile 1: Zeile 1:
 ====== Main Template and Subtemplate ======== ====== 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. +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. +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 templates ​and subtemplates: The main template contains the code that remains identical for all of Your site's pages, while subtemplates ​are injected into the main template's frame(s)+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 ==== ===== The Main Template ====
  
-<​code>​+<​code ​html>
 <​!doctype html> <​!doctype html>
 <html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​ <html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​
-    ​<​head>​ +<​head>​ 
-        <​we:​charset defined="​UTF-8">​UTF-8</​we:​charset>​ +    <​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 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">​ +    <meta http-equiv="​X-UA-Compatible"​ content="​ie=edge">​ 
-        <​we:​title></​we:​title>​ +    <​we:​title></​we:​title>​ 
-        <​we:​description></​we:​description>​ +    <​we:​description></​we:​description>​ 
-        <​we:​keywords></​we:​keywords>​ +    <​we:​keywords></​we:​keywords>​ 
-        <we:css id="​123"​ comment="​inserts a css-stylesheet with the WE-ID 123" /> +    <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" /> +    <we:js id="​124"​ comment="​inserts a javascript with the WE-ID 124" /> 
-    </​head>​+</​head>​
 <​body>​ <​body>​
  
     <​we:​content />     <​we:​content />
  
-    ​</​body>​+</​body>​
 </​html>​ </​html>​
 </​code>​ </​code>​
  
-Save this template as Main.tmpl (for example). ​Where You find <​we:​content />, the contents of the detail ​template are displayed(Whenever ​You change the main template now, webEdition asks You now whether it should rebuild the child templates.)+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 other sections in the page, use the <​we:​master>​- and <​we:​content>​-tag:​+If you need to fill **multiple ​sections** in the page, use the ''​<​we:​master>​''​- and ''​<​we:​content>​''​-tag:
  
-//Main.tmpl:// +//main.tmpl:// 
-<​code>​+<​code ​html>
 <​we:​content name="​preheader"/><​!doctype html> <​we:​content name="​preheader"/><​!doctype html>
 <html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​ <html lang="<​we:​pageLanguage type="​language"​ doc="​top"​ />">​
-    ​<​head>​ +<​head>​ 
-        <​we:​content name="​html_header"/>​ +    <​we:​content name="​html_header"/>​ 
-    </​head>​+</​head>​
 <​body>​ <​body>​
  
Zeile 45: Zeile 45:
     <​we:​content name="​body_end"/>​     <​we:​content name="​body_end"/>​
  
-    ​</​body>​+</​body>​
 </​html>​ </​html>​
 </​code>​ </​code>​
Zeile 51: Zeile 51:
 ==== The Subtemplate ==== ==== The Subtemplate ====
  
-//Page.tmpl: //  +//page.tmpl:// 
- +<​code ​html>
-<​code>​+
 <!-- This is displayed in we:content --> <!-- This is displayed in we:content -->
 Whatever Whatever
Zeile 73: Zeile 72:
 </​code>​ </​code>​
  
-Then, whenever You make a new template, ​You just give that template this one as main (parent) ​template under "​Properties" ​of the subtemplate.+Whenever you create ​a new template, ​you just define the master ​template under "​Properties"​.
en/webedition/beginners-guide/main-template.txt · Zuletzt geändert: 2019/02/09 21:35 von Sascha Nemecek

Recent changes RSS feed