Web template hook styles

Web template hook styles

:"This article is a supplement to the Delimiting and embedding strategies."

On web templates the separation of concerns (content from presentation) require a low-level separation strategy to isolate template language from output language.

Template syntax need special care with the "border" between languages, to avoid mixing and to supply scaping forms. There are well defined tags, marks or characteres, named "hooks", that intend to separate (compatibilize) the two languages.

Types of hook:
* "Script hooks": encloses blocks of developer-supplied program logic.
* "Sub-template hooks": to fix the frontiers of the sub-template block.
* "Expression hooks": to encode scalar variables, sub-template references, or expressions.

Note: formally, all template language need clear rules for "clean-up (or extract) the "template language" from the "output language". Hooks, scripts and expressions are extracted with the Clear(T) function.

There are a height diversity of implemented styles for hook encoding, and there are also web template systems with options to reconfigure "hooks".

The listings below show the hooks styles used on the web template system's examples.

Hook implemented notations

There are many styles of notations implemented (or configurable) on web template systems. To referentiate then on other articles, "style labels" was supplied.

cript hooks

Usual script hooks:, for instructions block.

ub-template hooks

See also Directive hooks with sub-templates, where, usually, the sub-templates are not-referenciable.

(referenciable) Sub-template hooks, to sub-template block definition:

Many template inlanguages offer also an internal syntax expression to interpolate strings. They use internal notation, like "string-hooks", for separation. Examples for specific expressions with interpolations:

Hook diversity

Basic factors:
# It is very ease to implement template engines to simple substitution template languages. If the application grow, and need more sophisticated language, it will be compatible with the first versions.
# The web template final user is, usually, a web designer. He/she deals with the templates through a web editor, like Dreamweaver. There are many editors and web designer needs may force template language to adapt to the editor's restrictions.

XML hook uniformazation tendency

There are a tendency on template languages to compatibilize hooks with the XML syntax rules. On XML it is possible to embed many languages together. A language namespace for tag names, are defined by prefix.

JSP example, for "specific hook notation" Versus "XML notation" (from the [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPX3.html#wp118565 J2EE 1.4 tutorial] ):

Another way to embed template language on XML languages, is to add special/reserved attributes. See Attribute languages.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Glossary of cue sports terms — The following is a glossary of traditional English language terms used in the three overarching cue sports disciplines: carom (or carambole) billiards referring to the various carom games played on a billiard table without pockets; pool (pocket… …   Wikipedia

  • performing arts — arts or skills that require public performance, as acting, singing, or dancing. [1945 50] * * * ▪ 2009 Introduction Music Classical.       The last vestiges of the Cold War seemed to thaw for a moment on Feb. 26, 2008, when the unfamiliar strains …   Universalium

  • The Emancipation of Mimi — The Emancipation of Mimi …   Wikipedia

  • King Crimson — This article is about the musical group. For the character in novels by Stephen King, see Crimson King. King Crimson King Crimson, 1982, l r Robert Fripp, Adrian Belew, Tony Levin, and Bill Bruford Background information …   Wikipedia

  • Earring — Infobox Piercing name = Earring nicknames = image size = 200px image capt = 1) Helix/Cartilage, 2) Industrial, 3) Rook, 4) Daith, 5) Tragus, 6) Snug, 7) Conch, 8) Anti Tragus, 9) Lobe location = Ear jewelry = Captive bead ring, barbell, circular… …   Wikipedia

  • Mariah Carey — This article is about the singer. For her self titled album, see Mariah Carey (album). Mariah Carey …   Wikipedia

  • Pushing the Senses — Infobox Album | Name = Pushing The Senses Type = Album Artist = Feeder Released = January 31, 2005 Recorded = 2004 Genre = Alternative rock Length = 40:13 Label = Echo Producer = Ken Nelson, Grant Nicholas, Gil Norton Reviews = * Q Rating|4|5… …   Wikipedia

  • The Princess and the Frog — Original theatrical release poster …   Wikipedia

  • MC Hammer — Hammer at TechCrunch in July 2008 …   Wikipedia

  • I Am... Sasha Fierce — I Am... Sasha Fierce …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”