Web template system: Difference between revisions

Content deleted Content added
HKAA own contents
Tags: Reverted Visual edit
Overview: clarification: similar visual format
 
(10 intermediate revisions by 9 users not shown)
Line 1:
{{Short description|System in web publishing}}
= '''Hong Kong Adventist Academy 香港復臨學校''' =
{{Multiple issues|
{{more citations needed|date=June 2008}}
Line 8:
[[File:TempEngWeb016.svg|thumb|The basic process for a server-side '''web templating system''': content (from a [[database]]), and "presentation specifications" (in a '''web template'''), are combined (through the [[template processor|template engine]]) to mass-produce web documents.]]
 
A '''web template system''' in [[web publishing]] allows web designers and developers to work with ''web templates'' to automatically generate custom [[web page]]s, such as the results from a search. This reuses static web page elements while defining dynamic elements based on [[HTTP request|web request]] parameters.
'''Hong Kong Adventist Academy (HKAA)''' located in [[Auburn, Washington|Clearwater Bay, Sai Kung Hong Kong SAR]] is a [[Mixed-sex education|co-educational]] [[Seventh-day Adventist church|Seventh-day Adventist]] English Medium school established in 2011 that offers a 1-12 program and has [[Boarding school|boarding]] facilities for grades 7 to 12. It is operated by the Chinese Union Mission (CHUM) of Seventh-day Adventists and is part of the [[Seventh-day Adventist education|Seventh-day Adventist education system]], the world's second-largest Christian school system.
Web templates support static content, providing basic structure and appearance. Developers can implement templates from [[content management system]]s, [[web application framework]]s, and [[HTML editor]]s.
 
== CAMPUS Overview==
A ''web template system'' is composed of the following:
'''HKAA School Campus: A Haven Amidst Nature'''
* A [[Template processor|template engine]]: the primary [[processing element]] of the system;<ref>{{cite web|title=Template engine |url=http://www.phpwact.org/pattern/template_view#separating_html_from_programming_code |publisher=phpwact.org wiki |access-date=7 January 2013 |url-status=dead |archive-url=https://web.archive.org/web/20121204081204/http://www.phpwact.org/pattern/template_view |archive-date=December 4, 2012 }}</ref>
* ''[[Content resource]]'': any of various kinds of input [[data stream]]s, such as from a [[relational database]], [[XML]] files, [[Lightweight Directory Access Protocol|LDAP]] directory, and other kinds of local or [[Computer networking|networked]] data;
* ''[[Template resource]]'': ''web template''s specified according to a [[template language]];
 
The template and content resources are processed and combined by the template engine to mass-produce web documents, each with a similar visual format. For purposes of this article, web documents include any of various output formats for transmission over the web via [[Hypertext Transfer Protocol|HTTP]], [[HTTPS]], or another [[Internet Protocol|Internet protocol]].
Located at 1111 Clear Water Bay Road, Sai Kung, NT, Hong Kong, SAR, Hong Kong Adventist Academy (HKAA) shares the campus with Hong Kong Adventist College (HKAC) and houses a few elegant historic buildings and heritage sites. Just a short distance away from the bustling high-rise apartments of Tseung Kwan O and the village houses of Sai Kung, HKAA school emerges amidst the lush greenery of the countryside, offering a serene and picturesque setting. The campus is only a short drive or hike away from the country park, country club, a few beaches, a fishing village, a high junk peak, and other exotic outdoor areas.  
 
===Template engine===
Perched on a hillside, HKAA provides a breathtaking view of the South China Sea and the enchanting islands that dot its waters. As the school day unfolds, the campus comes alive with the joyful laughter and exuberant shouts of children and young people moving between classes or playing out in the front lawn, basketball court, volleyball/badminton court, soccer field or the playground all located outdoors. They can be seen running and playing on the expansive grassy areas among the majestic trees that adorn the campus grounds or playing music in the dedicated music building or spending some quiet time in the glorious King Huy Worship Hall on campus.
{{Excerpt|Template processor}}
 
== Example ==
The natural beauty that surrounds the school serves as a powerful reminder of HKAA’s purpose and mission. It is HKAA’s belief that the school has been entrusted by God to not only coexist harmoniously with planet Earth but also to learn and grow from the wonders of His Creation.. HKAA campus, nestled in this idyllic setting, is a testament to its commitment to nurture young minds in a breathtaking and inspiring environment.
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:
<syntaxhighlight lang="html">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Sites</title></head>
<body><h1 data-xp="title"><!-- placeholder --></h1></body>
</html>
</syntaxhighlight>
 
Then, the control template loads the view, and then uses [[XPath]] addressing {{Original research inline|date=December 2013}} to insert components from a database, for instance:
'''''HISTORY, TRANSITION, REGISTRATION, ACCREDITATION AND AFFILIATION OF HONG KONG ADVENTIST ACADEMY'''''
<syntaxhighlight lang="php">
<?php
$doc = new DOMDocument;
$doc->preserveWhiteSpace = false;
$doc->Load('view.html');
$titlenode = $doc->createTextNode("Like this");
$xpath = new DOMXPath($doc);
$xpath->registerNamespace("h", "http://www.w3.org/1999/xhtml");
$query = "//h:*[@data-xp='title']/comment()";
$entries = $xpath->query($query);
foreach ($entries as $entry) {
$entry->parentNode->replaceChild($titlenode, $entry);
}
echo $doc->saveXML();
?>
</syntaxhighlight>
 
==Kinds of template systems==
In 2004, Sam Yuk Middle School, a local medium school formerly managed by Hong Kong Adventist College had to close after sixty five years of service. After it’s closure, the idea of an English medium school to meet the demands of the day is envisioned giving birth to HKAA.
 
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.
On March 15, 2011, Hong Kong Adventist Academy was officially registered as a private school with Hong Kong’s Education Bureau (EDB). HKAA is accredited by the Adventist Accrediting Association of Seventh-day Adventist Schools, Colleges, and Universities (AAA) which is the denominational accrediting authority for all educational programs and institutions owned by Seventh-day Adventist Church entities. The High School Program of HKAA is affiliated to Griggs International Academy (GIA) which is regionally accredited in the United States by Middle States Association of Colleges and Schools Commissions on Elementary and Secondary Schools. GIA is approved as a non-public school by the Maryland Board of Education for Kindergarten, Elementary and High School. ​HKAA is a College Board school that offers Advanced Placement classes.
 
* Server-side – run-time substitution happens on the web server
SEE ALSO - Hong Kong Adventist College (Links) - History
* 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:
== CURRICULUM ==
* Embedded or event-driven.
'''''HKAA Curriculum: A Fusion of Local & International Education'''''
* Simple, iterable, programmable, or complex.
* Defined by a consortium, privately defined, or de facto defined by an open implementation. Ownership influences the stability and credibility of a specification. However, in most jurisdictions, language specification cannot be copyrighted, so control is seldom absolute.
 
The source code of the [[Template engine (web)|template engine]] can be proprietary or [[open source]].
A transformative decision was made by the HKAA school board to redefine the school's academic direction. The school embraced a dynamic mix of local and international curricula meeting the local Education Bureau’s requirements for all subjects. Under this framework, the school would adopt a mix of Hong Kong and US curricula.
 
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}}
By blending elements of both global and local education, HKAA is committed to equipping students with a holistic and diverse learning experience. Our holistic curriculum as a foundation, complemented by the localized content, empowers students to develop a comprehensive understanding of various academic disciplines while embracing their cultural identity. This innovative approach sets HKAA apart, ensuring that students receive a well-rounded education that prepares them for a globally interconnected world.
 
===Language support===
== THE SPIRITUAL DIMENSIONS OF HKAA ==
[[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===
The unique Seventh-day Adventist spiritual aspects of HKAA are woven into the fabric of our school culture. From the religious education curriculum to daily prayer and devotions, chapel services, and transformative community service activities and mission trips, we strive to provide students with holistic spiritual growth opportunities. By nurturing their faith and encouraging them to actively live out their beliefs, HKAA aims to shape students who are not only academically accomplished but also spiritually grounded individuals.
{{Main|Static site generator}}
Static site generators are engines that use flat text input files like [[markdown]] and [[asciidoc]] to generate a [[static web page]]. Examples of this include [[Jekyll (software)|Jekyll]] (Liquid, [[Ruby (programming language)|Ruby]]), [[Hugo (software)|Hugo]] ([[Go (programming language)|Go]] templates), and Pelican ([[Jinja (template engine)|Jinja2]], [[Python (software)|Python]]).
 
===Static HTML Editors===
One of the distinctive features of HKAA is the integration of religious education and character development into the curriculum. Throughout their enrollment, all students are required to take religion or Ethics classes that delve into moral values and character building. These classes provide students with a foundation of spiritual knowledge, enabling them to understand the value of faith and its impact on various aspects of life, and to embrace the mission of HKAA - to find Jesus.
[[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>
'''''Prayer and Devotion in the Classroom'''''
 
[[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.
In addition to formal religion classes, the practice of prayer and devotion holds a significant place in the daily routine at HKAA. Teachers from diverse disciplines begin each day by leading a moment of prayer or sharing a brief devotional thought. This practice encourages students to actively engage in spiritual reflection and fosters a sense of unity and reverence within the school community.
 
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]].
'''''Weekly Assemblies'''''
 
=== Server-side systems ===
Every week, the entire student body of different sections come together in the auditorium for an assembly. This collective group experience serves as a focal point for spiritual growth and reflection as well as opportunities for students to engage in communal prayer, participate in worship songs, listen to guest speakers who share inspirational messages, career talks and various other learning experiences. Assembly services not only nurture the spiritual and emotional well-being of students but also provide a platform for them to showcase their talents on or back-stage.
[[File:ServerSideTemplates.gif|thumb|right|Server-side template system]]
People began to use [[dynamic web page#Server-side scripting|server-side dynamic pages]] generated from templates with pre-existent software adapted for this task. This early software was the [[preprocessor]]s and [[macro (computer science)|macro languages]], adapted for the web use, running on [[Common Gateway Interface|CGI]]. Next, a simple but relevant technology was the direct execution made on extension modules, started with [[Server Side Includes|SSI]].
 
Many ''template systems'' are typically used as ''server-side template systems'':
'''''Missions Trips: Embodying the Spirit of Service'''''
{| class="wikitable sortable"
! System label/name
! Platform/framework
! Notes
|-
| Blade
| [[PHP]]
| Public. Part of [[Laravel]]
|-
| [[CheetahTemplate]]
| [[Python (programming language)|Python]]
| Public. [[Web template#Template languages|Embedded complex language]].
|-
| [[Django web framework|Django]]
| [[Python (programming language)|Python]]
| Use the "Django template language".
|-
| EJS (Embedded JavaScript)
| [[JavaScript]]
| Public. [[Web template#Template languages|Embedded complex language]].
|-
| [[FreeMarker]]
| [[Java platform|Java]]
| Public.
|-
| [[Facelets]]
| [[Jakarta EE]]
| Public. Part of [[Jakarta Faces]]
|-
| [[Genshi (Templating Language)|Genshi]]
| [[Python (programming language)|Python]]
| Public
|-
| [[Haml]]
| [[Ruby (programming language)|Ruby]] or Other
| Public.
|-
| Hamlets
| [[Java (programming language)|Java]]
| Public.
|-
| [[Jinja (template engine)|Jinja2]]
| [[Python (programming language)|Python]]
| Public. [[Web template#Template languages|Embedded complex language]].
|-
| [[Kid (templating language)|Kid]]
| [[Python (programming language)|Python]]
|
|-
| [[Lasso programming language|Lasso]]
| [http://www.lassosoft.com/ LassoSoft, LLC]
| Proprietary. [[Interpreter (computing)|Interpreted]] [[Programming language|Programming Language]] and [[Server (computing)|Server]]
|-
| [[Mustache (template system)|Mustache]]
| [[ActionScript]], [[C++]], [[Clojure]], [[CoffeeScript]], [[ColdFusion]], [[D (programming language)|D]], [[Erlang (programming language)|Erlang]], [[Fantom (programming language)|Fantom]], [[Go (programming language)|Go]], [[Java (programming language)|Java]], [[server-side JavaScript]], [[Lua (programming language)|Lua]], [[.NET Framework|.NET]], [[Objective-C]], [[ooc(programming language)|ooc]],<ref>{{cite web|title=<nowiki>{{mustache}}</nowiki>|url=https://mustache.github.io/|access-date=15 October 2013}}</ref> [[Perl]], [[PHP]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Scala (programming language)|Scala]], [[Tcl]]
| Public.
|-
| Basic [[Server Side Includes]] (SSI)
| The [[Server Side Includes#Directives|basic directives]] fix a "standard".
| [[Web template#Template languages|Embedded simple language]], if exclude <code>exec</code> directive.
|-
| [[Smarty (template engine)|Smarty]]
| [[PHP]]
| Public. [[Web template#Template languages|Embedded complex language]].
|-
| [[Template Toolkit]]
| [[Perl]]
| Public. [[Web template#Complex templates|Embedded complex language]].
|-
| [[Template Attribute Language]] (TAL)
| [[Zope]], [[Python (programming language)|Python]], [[Java (programming language)|Java]], [[Perl]], [[PHP]], [[XSLT]]
| Public; a.k.a. [[Zope#Zope Page Templates|Zope Page Templates (ZPT)]]; see also [[TALES|TAL Expression Syntax]] (TALES), [[METAL|Macro Expansion TAL]] (METAL)
|-
| [[Java view technologies and frameworks#Apache Tiles|Tiles]]
| [[Java platform|Java]]
| Public. Supports multiple template languages (JSP, Velocity, Freemarker, Mustache) from various frameworks (servlet, portlets, struts, spring).
|-
| [[Thymeleaf]]
| [[Java platform|Java]]
| Public.
|-
| Topsite
| [[Python (programming language)|Python]]
| Public. ''"As of 2008-02-20, this project is no longer under active development."''<ref>{{cite web|last=jodyburns|title=Topsite Templating System|url=https://sourceforge.net/projects/topsite/|access-date=15 October 2013}}</ref>
|-
| [[Twig (template engine)|Twig]]
| [[PHP]]
|
|-
| [[Standard PHP Library#PHPlib|PHPlib]]
| [[Standard PHP Library#PHPlib|PHPlib]]
| Public. [[Web template#Template languages|Embedded iterable language]].
|-
| [[WebMacro]]
| [[Java platform|Java]]
| Public. [[Web template#Template languages|Embedded iterable language]].
|-
| [[WebObjects]]
| [[Java platform|Java]]
| Use the [[WebObjects#Core frameworks|WebObjects Builder]] as engine.
|-
| [[Apache Velocity|Velocity]]
| [[Java platform|Java]]
| Public. Use VTL - [https://velocity.apache.org/engine/devel/vtl-reference.html Velocity Template Language].
|-
| [[Vignette (software)|Vignette]]
| Proprietary.
| Commercial solution. [[Web template#Template languages|Embedded complex language]].
|-
| [[XSLT]] (standard language)
| Any with an XSLT parser
| Standard. [[Web template#Template languages|Event-driven programmable language]].
|-
| [[XQuery]] (standard language)
| Any with an XQuery parser
| Standard. [[Web template#Template languages|Embedded programmable language]].
|}
 
Technically, the methodology of embedding programming languages within HTML (or XML, etc.), used in many "server-side included script languages" are also templates. All of them are [[Web template#Template languages|Embedded complex languages]].
One of the most impactful spiritual activities offered at HKAA is the annual Mission Trip. As part of their community service requirement, high school students embark on these transformative journeys. These trips provide a unique opportunity for students to serve those in need and experience the true spirit of compassion and selflessness.
{| class="wikitable sortable"
! System label/name
! Notes
|-
| [[Active Server Pages]] (ASP)
| Proprietary ([[Microsoft|Microsoft platform]]). See also: [[VBScript]], Javascript, [[PerlScript]], etc. extensions for ASP.
|-
| [[eRuby]]
| Public ([[Ruby (programming language)|Ruby]]).
|-
| [[ColdFusion Markup Language]] (CFM)
| Public ([[Lucee]], [[Railo]], OpenBD). Proprietary ([[Adobe ColdFusion]]).
|-
| [[Jakarta Server Pages]] (JSP)
| Public, [[Jakarta EE]].
|-
| [[Perl|Active Perl]]
| Public.
|-
| [[PHP]]
| Public.
|-
| [[OpenACS]]
| Public ([[Tcl]]).
|}
 
There are also [[preprocessor]]s used as [[template engine (web)|server-side template engines]]. Examples:
In 2022, our students traveled to an orphanage in Cambodia, where they engaged in various tasks aimed at improving the lives of the residents. From repairing the building to teaching English to students and even painting walls, our students actively contributed to the betterment of the community. These Mission Trips not only instill a sense of empathy and social responsibility but also allow students to embody the teachings of Jesus by serving others.
{| class="wikitable sortable"
! [[Preprocessor]]
! Notes
|-
| [[C preprocessor]]
| Public. [[Web template#Template languages|Embedded iterable language]].
|-
| [[M4 (computer language)|M4]]
| Public. [[Web template#Template languages|Embedded complex language]].
|}
 
===Edge-side systems===
Edge-Side template and inclusion systems. "Edge-side" refers to web servers that reside in the space between the client (browser) and the originating server. They are often referred to as "reverse-proxy" servers. These servers are generally tasked with reducing the load and traffic on originating servers by caching content such as images and page fragments, and delivering this to the browser in an efficient manner.
 
Basic [[Edge Side Includes]] (ESI) is an SSI-like language. ESI has been implemented for content delivery networks. The ESI template language may also be implemented in web browsers using JavaScript and Ajax, or via a browser "plug-in".
 
===Client-side systems===
[[File:ClientSideTemplates.gif|thumb|right|Client-side and [[Distributed computing|distributed]] (decentralized) template system.]]
{{see also|JavaScript templating}}
Many web browsers can apply an [[XSLT]] stylesheet to XML data that transforms the data into an XHTML document, thereby providing template functionality in the browser itself.<br />
Other systems implement template functionality in the browser using [[JavaScript]] or another [[client-side scripting]] language, including:
* [[Mustache (template system)|Mustache]]
*[https://github.com/nebrelbug/squirrelly Squirrelly]
*[https://handlebarsjs.com/ Handlebars]
 
=== Distributed systems ===
The most simple form is [[transclusion]]s (HTML frames). In other cases [[dynamic web page]]s are needed.
 
Examples:
* [[Ajax (programming)|Ajax]]
* [[Rich Internet application]]
 
==See also==
{|
|-
|Concepts:
* [[Boilerplate code]]
* [[Bytecode]]
* [[Comparison of web template engines]]
* [[Browser engine|Layout engine]]
* [[Macro (computer science)#Text-substitution macros|Text substitution macros]]
* [[Preprocessor]]
* [[Template processor]]
* [[Template (file format)]]
* [[Transclusion]]
* [[Virtual machine]]
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
|valign="top"|Standards:
* [[UIML]] (User Interface Markup Language)
* [[XSLT]] (Extensible Stylesheet Language Transformations)
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
|valign="top"|Software:
* [[CodeCharge Studio]]
* [[Jekyll (software)|Jekyll]]
|}
 
==References==