XS Labs

Tip: HTML template for starting new pages quickly

by pompo500 on Aug.01, 2010, under Software

This tip is particularly useful for us webheads.

Ever been frustrated when typing the same <html><head><title>..</title><link>…</link></head><body><div>.. stuff over and over again?

Wouldn’t it be wonderful by just right-clicking on the desktop or inside a folder and just picking “New -> Firefox Document”, then Windows creating a fresh template for you with the most frequently used tags already typed in?

Here’s my template, for example: (Download as file: HTML Template)

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html>
<head>
<title>Title</title>
<link type=”text/css” rel=”stylesheet” href=”style.css” />
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”></script>
<script type=”text/javascript”>
$().ready(function() {
});
</script>
</head>
<body>

<div>
<h1>Heading</h1>

<p>Paragraph</p>
</div>

</body>
</html>

This can be easily  achieved without any third-party software by creating a template file in Windows.

Instructions for doing this: (should work with Windows Vista / 7 at least, most probably XP too)

  1. Right click on “Start menu > All programs > Accessories > Notepad”
  2. Click “Run as administrator” (only administrators can write to the folder in step 4)
  3. Copy-paste the code from the file presented above (download the file, the Blog software manhandles the line feeds and tabs)
  4. Save file as C:\Windows\ShellNew\html.html
  5. Open registry editor from Start menu > “regedit.exe” (type into the free text box and press enter)
  6. Go to HKEY_CLASSES_ROOT\.html\ShellNew
  7. Right click on New -> String Value
  8. Set values accordingly: Name = FileName, Data = html.html
  9. That should be it. If it doesn’t work right away, perhaps you need to logout and log in again. If it still doesn’t work, read the instructions again and make sure you followed them precisely.

Happy and productive coding from XS Labs!


Leave a Reply

Public service announcement

From the council of desultory bulletins:

The rate, at which feces fly, is simply stunning compared to the ionized gaps between nanoparticles upon impact of the floral microscopic patterns of neutron stars.
You should think about it for a moment. After all, it affects the longevity of random synergized spatulas.