[Bug 17128] New: Suggestion for HTML5 feature: Templates I've noticed that a lot of websites use similar-looking elements that could be better implemented using "templates" - reusable components that are transcluded into Web pages and take arguments that affect the way th

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17128

           Summary: Suggestion for HTML5 feature: Templates I've noticed
                    that a lot of websites use similar-looking elements
                    that could be better implemented using "templates" -
                    reusable components that are transcluded into Web
                    pages and take arguments that affect the way th
           Product: HTML WG
           Version: unspecified
          Platform: Other
               URL: http://www.whatwg.org/specs/web-apps/current-work/#top
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Specification: http://www.w3.org/TR/html5/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
Suggestion for HTML5 feature: Templates

I've noticed that a lot of websites use similar-looking elements that could be
better implemented using "templates" - reusable components that are
transcluded into Web pages and take arguments that affect the way they are
displayed. Most sites that use templates, such as Wikipedia, implement them
through server-side includes (SSIs) - which makes editing wiki pages more
convenient but requires preprocessing each time a page is edited.

In Wikipedia's specialized syntax, the name of the template is enclosed in
double curly braces and parameters are separated by a pipe. For example, a
particular template that tells other editors that a Web page needs to be
cleaned up is inserted into the page, along with a parameter called "date", by
typing:

{{cleanup|date=January 2010}}

This produces (approximately) the message:

"This article may require cleanup to meet Wikipedia's quality standards.
(Tagged since January 2010.)"

This, however, must be replaced with the actual code for the template each
time the page is saved (which the server has no trouble doing but can be
problematic when you do this manually). Additionally, some pages are made
entirely out of templates and the code for these eats away at bandwidth on
slow connections.

So I was thinking: HTML5 should include native support for client-side
template inclusions. This would make it easier to create a uniform appearance
on Web pages when designing them manually, and reduce bandwidth by caching
templates. (External CSS and JS files already reduce bandwidth.) For example,
skins could be implemented through a combination of CSS, JS and templates.

Suggested syntax for templates:

<!-- src attribute tells browser where to get the code for the template -->
<template src="http://not-a-real-url.com/bin/templates/my-template.htt">
 <param name="text">The parameter called "text" goes here.</param>
</template>

Contact me via my talk page on Wikipedia by going to
http://en.wikipedia.org/wiki/User_talk:68.173.113.106 and clicking Edit.

Posted from: 68.173.113.106
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko)
Chrome/19.0.1084.46 Safari/536.5

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Monday, 21 May 2012 09:43:45 UTC