Copy link to clipboard
Copied
I seem to remember in older versions of Dreamweaver, the user could alter the starting HTML code for a new HTML document so that each time a new page was created, these alterations were included. I understand that I can create a template file and use that, but that strikes me as adding just more bloat if I can just edit the starter file.
I would like to have a new HTML document have included in its head, the html5shiv. Right now, I am using a code snippet to accomplish this, but it would be better if it was automated.
Is there a way to do this?
If you're talking about the html generated when you go to File > New... > New Document > HTML, it's pretty simple...
1. On a Windows machine, go to C (or your drive number where DW is installed) > Program Files > Adobe > Adobe Dreamweaver (your version) > configuration > DocumentTypes > New Documents > Default.html
2. As always, make a backup
3. Open that file in some other editor besides DW
4. Make changes as you see fit, though it's worth noting the doctype and chrset meta will change automaticall
Copy link to clipboard
Copied
I create a dummy page in my local site with the base code I intend to use on site wide pages. It consists of the common head, header, footer, scripts, CSS, Server-Side Includes, etc....
I do this for every site I manage and I keep a copy of the dummy page on my remote servers as a backup.
Optionally, you could create a custom Snippet. Or you could create a Template.dwt. I don't personally use Templates because I prefer Server-Side Includes.
Copy link to clipboard
Copied
If you're talking about the html generated when you go to File > New... > New Document > HTML, it's pretty simple...
1. On a Windows machine, go to C (or your drive number where DW is installed) > Program Files > Adobe > Adobe Dreamweaver (your version) > configuration > DocumentTypes > New Documents > Default.html
2. As always, make a backup
3. Open that file in some other editor besides DW
4. Make changes as you see fit, though it's worth noting the doctype and chrset meta will change automatically depending on what you're settings show in DW's preferences, so there's no need to change them
5. Save (you will need Admin rights to change the file)
Copy link to clipboard
Copied
This worked, however; a few extra steps were required.
I don't have another editor (Adobe's Dreamweaver makes that unnecessary :c) ), so I opened it in notepad. The folder would not permit me to save the altered file so I had to save it in the documents folder for the C: drive. I then needed to copy/paste that file to the dreamweaver/documentstypes/newdocuments/ folder.
Thanks for your help! I now get this when I create a new HTML5 document:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
</body>
</html>
Copy link to clipboard
Copied
Mine is somewhat similar, though I add in a mini CSS reset and an empty description meta.
My html5.js link is a little different too...
<!--[if lt IE 9]>
<script src="http ://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
(without the space after the http) that way, I don't have to add a copy of the html5.js file in each site folder.