Web template system: Difference between revisions

Content deleted Content added
ndash
Tags: Mobile edit Mobile web edit
Line 23:
 
== Example ==
With the model typically held in a relational database, the remaining components of the [[model–view–controller|MVC]] architecture are the control and view. In the simplest of systems these two are not separated. However, adapting the [[separation of concerns]] principle one can completely decouple the relationships.
 
For example, the view template may look like this:
Line 56:
A web browser and web server are a [[client–server]] architecture. Sites often also use a [[web cache]] to improve performance. Five templating system types are classified based on when they replace placeholders with real content and assemble pages.
 
* Server-side - run-time substitution happens on the web server
* Client-side - run-time substitution happens in the web browser
* Edge-side - run-time substitution happens on a proxy between web server and browser
* Outside server - static web pages are produced offline and uploaded to the web server; no run-time substitution
* Distributed - run-time substitution happens on multiple servers
 
Template languages may be:
Line 69:
The source code of the [[Template engine (web)|template engine]] can be proprietary or [[open source]].
 
Many template systems are a component of a larger programming platform or framework. They are referred to as the "platform's template system". Some template systems have the option of substituting a different template language or engine.{{citation needed|date=August 2013}}
 
===Language support===
[[Programming languages]] such as [[Perl]], [[Ruby (programming language)|Ruby]], [[C (programming language)|C]], and [[Java (programming language)|Java]] support template processing either natively, or through add-on libraries and modules. [[JavaServer Pages]] (JSP), [[PHP]], and [[Active Server Pages]] (ASP with [[VBScript]], [[JScript]] or other languages) are examples, themselves, of web template engines. These technologies are typically used in server-side templating systems, but could be adapted for use on an "edge-side" proxy or for static page generation.
 
===Static site generators===
Line 81:
[[File:StaticTemplates.gif|thumb|right|Outside server template system architecture.]]
 
[[HTML editor]]s often use web template systems to produce only [[static web page]]s. These can be viewed as a ready-made [[web design]], used to mass-produce "cookie-cutter" [[website]]s for rapid deployment. They also commonly include themes in place of [[Cascading Style Sheets|CSS]] styles. In general, the template language is used only with the editor's software.<ref>{{cite book|last1=MacDonald|first1=Matthew|title=Creating a Website: The Missing Manual|date=2015|publisher=O'Reilly Media, Inc.|___location=Chapter 8 > Putting the Same Content on Multiple Pages > Web Templates > Note box|isbn=9781491936177|url=https://books.google.com/books?id=ZJTuCQAAQBAJ|access-date=19 January 2016}}</ref>
 
[[Microsoft FrontPage|FrontPage]] and [[Macromedia Dreamweaver|Dreamweaver]] were once the most popular editors with template sub-systems. A Flash web template uses [[Adobe Animate|Macromedia Flash]] to create visually interactive sites.
 
Many ''server-side template systems'' have an option to publish output pages on the server, where the published pages are [[static web page|static]]. This is common on [[content management system]]s, like [[Vignette (software)|Vignette]], but is not considered out-server generation. In the majority of cases, this "publish option" doesn't interfere with the ''template system'', and it can be made by external software, as [[Wget]].