Jump to content
Stef's Coding Community

How to Change EW's "Open New Page" Default Code


Recommended Posts

When you start a new page in Expression Web (EW) it will open up with some basic code such as Doctype, html, head and body tags. You may find this a bit thin for a basic new page and so I dug up an old FrontPage method that I used in the past on how you can edit the default code for each 'New Page' you start.

 

Note: I am using Expression Web 3 in this tip.

 

First, let's look at the out-of-the-box code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>

</body>

</html>

 

As you can see it's just a basic but necessary code as I mentioned earlier.

 

First note that the Doctype can be changed via EW by going Tools -> Page Editor Options and click on Authoring tab.

 

Here you can see that it is using the XHTML 1.0 Transitional Doctype. You can change it to whatever you want but HTML 4.01 Strict is preferred.

 

Now in order to change the rest of the default code one will have to open Windows Explorer and navigate to the file that we need to edit. A sample path to find the file to edit is below:

 

C:\Program Files\Microsoft Expression\Web 3\en\PAGES

 

Earlier versions of EW might differ.

 

You should see a group of folders with the .tem extension. .tem means template.

 

Open the normal.tem folder. There you will find 3 files. The one you want to edit is called NORMAL.HTM.

 

Open the file using Notepad by right-clicking on it, select Open With... and choose Notepad. This is what you will see:

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" x-undefined />
</head>

<body>

</body>

</html>

 

If your review the codes carefully you will notice that there is no Doctype listed. This is because the Doctype is inserted each time you start a new page and is set via EW by the method I mentioned earlier.

 

Here is where you can add just about any code you would like for any new page you start.

Below is a simple example that I use:

 


<html>
<head>


<title>Page Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="**********************">
<meta name="description" content="**********************">
<meta name="robots" content="index,follow">
<meta name="distribution" content="global">
<meta name="googlebot" content="index,follow">
<meta name="rating" content="General">
<meta name="REVISIT-AFTER" content="5 days">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-contol" content="no-cache">
<meta name="robots" content="FOLLOW,INDEX,noarchive">
<meta name="GOOGLEBOT" content="NOARCHIVE">
<meta name="ROBOTS" content="NOODP">

<link rel="stylesheet" href="filename.css" type="text/css">

</head>

<body>

</body>
</html>

 

Save the file and try it out.

 

You can add just about anything you want but the idea here is to add only the code that you are going to use for every page you start.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...