These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:04 pm Advanced search

static web pages: templates

Here you can discuss stuff that doesn't fit elsewhere; anything you want really.

static web pages: templates

Postby PMB9 » Wed Feb 18, 2009 6:48 pm

I'd like to see more support for static web pages.

I don't want to copy my website template with the menu to all my web pages.

Code: Select all

example page:
<html>
<head>
  <title>example page</title>
  <template src="template"/>
</head>
<body>
  <p>example content</p>
</body>
</html>

template:
<template>
<head>
</head>
<body>
  <p>Advertising: Klick <a href="ads">here</a>, to buy best products!</p>
  <menu>
   <li>Main page</li>
   <li>About me</li>
   <li>History</li>
  </menu>
  <content/>
  <p>(c) by foo baz</p>
</body>
</template>

PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Postby lyosha » Tue Feb 24, 2009 9:13 pm

That should be taken care of on the server side. Such templating on the client side will never degrade gracefully in older browsers and is way beyond the scope of a markup language, IMHO.
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby PMB9 » Sun Mar 01, 2009 2:42 pm

[..] is way beyond the scope of a markup language, IMHO.


Sorry. Is there any whatwg forum for non-html5 discussions?

Such templating on the client side will never degrade gracefully in older browsers


The server could check if the client is able to handle templates.

That should be taken care of on the server side.

No. Just think why frames were so popular. You don't need a CMS, only FTP and a web editor to publish content. If you click on a menu entry, only the document is replaced, not the whole website template. There are some problems with frames: you can't have nice URLs, there's no nice integration (design!). My proposed template design does not have these problems.
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Postby JAB Creations » Mon Mar 02, 2009 1:15 am

This forum is for HTML5 specs, not general HTML templates. Moving the thread to off-topic forums as this thread has nothing to do with HTML5's specs.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby mskinner » Mon Mar 02, 2009 2:14 am

Maybe he's asking for the equivalent of server side includes however in [X]HTML? Server side includes may be dependent on which web server is hosting, reducing the portability of the site.

So instead of:
Code: Select all
<html>
<body>
Header
Navigation
Content
Footer
</body>
</html>

(where the header, nav and footer are in every page)

You could have:
Code: Select all
<html>
<body>
<include src="header.htmp" />
<include src="navigation.htmp" />
Content
<include src="footer.htmp" />
</body>
</html>


The differences from the iframe are:

1) The html part includes would not be complete documents. The parent element might be a div or something.

2) There would be no scrollbars on the includes - if the content inside one include is 400px tall, then the include would result in the parent page being 400px taller. If the text is made larger, then it would be taller still.

I can't remember the old ilayer/layer behaviour to compare. Unfortunately this would not degrade to existing browsers at all, which would be a show stopper.

Maybe I have misunderstood PMB9? Or I need more sleep...
mskinner
<h2>
 
Posts: 116
Joined: Sun Jun 24, 2007 12:20 am
Location: Melbourne, Australia

Postby PMB9 » Tue Mar 03, 2009 3:03 pm

NO!! Your idea is very bad. You can compare your idea with <span style="include(big.css)">Big text</span>.
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Important feature for the Web

Postby PMB9 » Fri Mar 06, 2009 6:11 pm

Client side templates have got features which server side templates do not have:
  • You can run javascript per website instead of per page
  • The animation in the header will go on if you click on another page
  • You don't need a CMS.
  • You can use desktop software to write an article and publish it with FTP.
  • You can cache all pages easily. You don't need to refresh every page cache when you change the template.
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Re: Important feature for the Web

Postby lyosha » Fri Mar 06, 2009 11:05 pm

PMB9 wrote:Client side templates have got features which server side templates do not have:
  • You can run javascript per website instead of per page
  • The animation in the header will go on if you click on another page
  • You don't need a CMS.
  • You can use desktop software to write an article and publish it with FTP.
  • You can cache all pages easily. You don't need to refresh every page cache when you change the template.


Um, server-side:
  • You can run javascript per website instead of per page - check, unless you mean running continually
  • The animation in the header will go on if you click on another page - interesting idea, but in no way backwards compatible, though frames are still an [awful] option for degrading; won't be graceful though
  • You don't need a CMS. - check
  • You can use desktop software to write an article and publish it with FTP. - check; have you even looked at all the server-side templating options?
  • You can cache all pages easily. You don't need to refresh every page cache when you change the template. - check, set up caching correctly


Only one point (2) was right, the rest can easily be accomplished server-side. Another option is AJAX navigation, then all the points would be possible with current technology without breaking backwards compatibility.
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby PMB9 » Sat Mar 07, 2009 9:32 am

Note that, if you use AJAX navigation, you don't have nice URLs.

OK, if server-side templating is really better (I don't think so), I like to use an server-side template standard. Server Side Includes is bad. Do you know a nice Apache mod?

Client side templates are the only way to allow the client to cache the template.
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Postby lyosha » Wed Mar 11, 2009 3:53 am

PMB9 wrote:Note that, if you use AJAX navigation, you don't have nice URLs.


I've actually done that before as an expirement. Gmail does AJAX navigation with nice clean URLs as well. You use the hash pretty much (#).

As for a templating standard, there isn't one, choose whichever fits you best. A simple way is to use a PHP page that includes data it is asked to.

Client side templating would require a whole new language to replace HTML though and would require new browsers which would understand that language.
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby PMB9 » Sun Mar 15, 2009 2:28 pm

Client side templating would require a whole new language to replace HTML though and would require new browsers which would understand that language.

Why it needs to replace HTML?
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Postby lyosha » Mon Mar 16, 2009 9:54 pm

Because HTML is not capable of being a template language. Adding templating functionality to HTML would effectively redifine what HTML is, which will lead to two things: 1. People will argue it's a new language distinct from HTML, just like XHTML 2.0. 2. Browser vendors will refuse to take WHATWG seriously with such a huge revision to HTML, just like they did with the W3C when they came up with XHTML 2.0 and a new group will form like TGTDHTWBVCAI (The Group That Defines HTML The Way Browser Vendors Can Actually Implement).

XHTML 2.0 is implentable, and so is your idea, but they both require reworking browsers from scratch: not something any major browser vendor wants to do. If your idea or XHTML 2.0 gets any new browser vendors developing for it, they will not gain traction very fast, so only 0.05% of the population will be able to visit your websites. That's the whole point of backwards compatibility: to be accessible to the other 99.95% of people browsing the web.

In fact, your request would better be received as a request for an extension to XHTML 2.0 rather than a revision for HTML 5.
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby PMB9 » Mon Mar 23, 2009 2:40 pm

I hope you only dislike my idea because of backwards compatibility. The best reason for client-side templates: You can use HTTP PUT feature. I like to use the PUT feature in spite of the original vision of the Web as a space for collaboration.

The XHTML way:
Code: Select all
example page:
<?xml-stylesheet type="application/xtemplate+xml" href="template" ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
  <head>
    <title>example page</title>
  </head>
  <body>
    <p>example content</p>
  </body>
</html>

template:

<template xmlns="http://www.w3.org/2009/xtemplate">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
    <head></head>
    <body>
      <p>Advertising: Klick <a href="ads">here</a>, to buy best products!</p>
      <menu>
        <li>Main page</li>
        <li>About me</li>
        <li>History</li>
      </menu>
      <content xmlns="http://www.w3.org/2009/xtemplate" />
      <p>(c) by foo baz</p>
    </body>
  </html>
</template>

PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Postby lyosha » Mon Mar 23, 2009 9:46 pm

PMB9 wrote:I hope you only dislike my idea because of backwards compatibility.


Yeah, that's pretty much it. It's just not a realistic idea to put into the HTML 5 spec. The idea all in itself isn't a bad one. I probably wouldn't use it much though since I wouldn't want to implement backwards compatibility in Javascript for current browsers and I already use server-side technology to accomplish what I need.

The best reason for client-side templates: You can use HTTP PUT feature. I like to use the PUT feature in spite of the original vision of the Web as a space for collaboration.


OK, you lost me there. PUT is for updating a resource on the server, it would be nice if browsers implemented it via <form method="PUT"> with current HTML technology (browsers supporting PUT would be supporting an essential HTTP feature, but that has [almost] nothing to do with HTML). I don't see how the templates has anything to do with PUT support since HTML is only a representation of a resource and not a resource itself.
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby PMB9 » Tue Mar 24, 2009 5:25 pm

You can only edit an resource if you are able to read the resource itself. If you can only read the "representation of a resource", you can't edit the resource.
PMB9
<h3>
 
Posts: 50
Joined: Sat Jan 26, 2008 5:38 pm

Next

Return to Off Topic

Who is online

Users browsing this forum: No registered users and 1 guest