Page Editor Options - Authoring Tab

Tina Clarke

 

Define your Default HTML File Extensions and read about if you should ban the BOM or not. Find out about a little known bug and one to be aware of.

 

 

Part 6 - Setting up Expression Web - Page Editor Options - Authoring Tab

Applies to Expression Web 2.0, 3.0 & 4.0 Only New

Choose the default type of new documents and the default file extension of new HTML documents.

Authoring Tab EW 2.0.
Fig 1 - Page Editor
Options - Authoring Tab


EW 3.0/4.0
- Fig 2 - Page Editor Options - Authoring Tab

 

EW 4.0 SP2 - Page Editor Options - Authoring Tab

EW 3.0/4.0 SP2 - Fig 3 - Page Editor Options - Authoring Tab

(Click thumbnails to enlarge)

 

Doctype and recommended Schema Settings

  1. Document Type Declaration: XHTL 1.0 transitional
  2. CSS Schema: CSS 2.1
  3. Secondary Schema: Internet Explorer 8.0

ALL Expression versions were built with the adoption of the UTF-8 Character Set as the default which is the recommendation of the W3C,  who define Internet standards.

UTF-8 Character Set (Charset) example - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

HOWEVER at this time not all applications and servers can handle UTF-8, in particular those that handle php documents and that includes the W3C validator too.

What are charsets, character sets or character encoding?

"Conventionally character set and character encoding were considered synonymous, as the same standard would specify both what characters were available and how they were to be encoded into a stream of code units. For historical reasons, MIME and systems based on it use the term charset to refer to the complete system for encoding a sequence of characters into a sequence of octets." Ref: Simple Character Sets

Character sets are are used to identify the encoding of a file and using the UTF-8 charset (8-bit Unicode Transformation Format) when it is not supported can cause characters such as ï«¿. to appear in your documents and might also create other issues, the characters are called a Byte-Order Mark (BOM).

In Expression Web 1.0 a BOM was included by default when any file was created and there was no way natively other than opening a file in a text editor to remove them. With the exception of the .css file where upon you can use the encoding selection on the right click menu to open the 'Encoding Text File' dialog box in a .css file to select or unselect your encoding.

Though you can't remove the BOM natively within Expression Web 1.0, Steve Easton has developed a method of Banning the BOM and Christoph Schneegans has written a VBA macro which can be run in EW 1.0. Make sure you back up your website before using either method.

However in Expression 2.0 & 3.0 & 4.0 settings are provided on the Authoring Tab so you can enable or disable the BOM at will in other file extensions pages (see listed below).'

Add a byte order mark (BOM) when creating or renaming UTF-8 documents with these file extensions in Expression Web 2.0, 3.0 or 4.0

  • .htm
  • .html
  • .css
  • .dwt
  • .js
  • .php
  • .txt
  • .xml

Recommended setting for the byte order mark in Expression Web 2.0, 3.0 & 4.0 for new documents

By default all settings are ticked except the PHP extension un-tick in particular the following: .htm .html .css .dwt .php, only retick when needed.

So unless you understand how to deal will UTF-8, in most cases I recommend using the character set below for your individual pages.

<meta http-equiv="Content-Type" content="text/html; charset=iso- 8859-1" />

NOTE: This should always be positioned just above your Page Title in Code View

Add or Remove the BOM from existing individual pages

 Encoding EW 2.0.

 

Fig 4 - Language Tab - Encoding (click thumbnail to enlarge)

 

You can access the 'Language' Tab on the 'Page Properties' dialog box either by:

  • Right click in Design View and choose Page Properties - Language Tab
  • Go to File - Properties  - Language Tab
  • Right click in Code View and click Encoding

I recommend the last option as it will take you right to the 'Language' Tab without having to select it

In the 'Language' Tab select or clear 'Include a byte order mark (BOM)'

NOTE: The option 'Include a byte order mark (BOM)' is not available if 'Save the document as:' is not set to Unicode (UTF-8).

Set the default encoding of the site character set

Site Settings EW 2.0.

 

Fig 5 - Site Settings - Language Tab EW 1.0/2.0 (click to enlarge)

 

 

Fig 6 - Site Settings - Advanced Tab EW 3.0/4.0 (click to enlarge)

 

 

 

The Default Encoding on the 'Language' Tab  in the Site -  Site Settings dialog box for the Site character set is established as UTF-8

To change the encoding select the down arrow next to the Default Page Encoding and choose the charset you want.

NOTE: If you change the encoding to another charset, when publishing to some servers you may get the following error message

Change Charset ew 2.0.

Fig 7 - Character Set Error Message

 

"The character set 'iso-8859-1' for the source web site 'example site' is not supported on the destination web server 'http://example-site.com/'. No files were published. To change the character set for the current open Web site, choose Site Settings on the Site menu."

It might be easier for blank new pages to carry the encoding you want to reset the default encoding of the site character set, then when you have finished making the site to change the setting back to UTF-8, if your server like mine throws up this error. I usually use dwts and have the character already set to iso-8859-1 within the template, so for me this method is usually not needed.

PHP Includes with menus in Expression Web 1.0

In Expression Web 1.0 PHP Includes are not incorporated natively within the program, coupled with the BOM problem this can be a bit of a quandary to say the least. However one method to get around this is to use the extension .inc instead of .php, this is not recommended and is very unsafe when your files are to do with databases where passwords and strings might be used, as it will display your coding. If a .php extension is used then the server will run the script and only the output will be seen, so .inc should only be used for simple innocuous files like menus, that must been seen anyway.

How to make a .inc file

Go to File - New - Page - Text File
File - Save As - Where it says 'Save as Type' Select 'All Files' and save

Text File Encoding.

 Fig 8- Text File Encoding (click to enlarge)

 

 

To access the Language Tab within a .inc file, right click and choose Encoding and the 'Text File Encoding' dialog will appear, whereupon you can unselect the BOM.

Default HTML File Extension

By selecting either .html or .htm you can set the default html file extension for newly made pages. Check which one your host uses if you are not sure which one to choose.

.htm bug EW 3.0 and 4.0 only

There is a bug in Expression Web 4.0 whereby if you have this setting on .htm when you select either one of the program's default generic Site Templates (or even Pat Geary's and my self's Site Templates) and make a Site from them you will see as if by magic the index.html page change to default.html, this is a little known bug. If you have it set to .html then your homepage extension will remain index.html. Of course you can rename your homepage file to whatever your host requires by right clicking on the selected link in Folder List View (EW 3.0/4.0 Panels - Folder List or Alt + F21) and choosing Rename. When you select either .htm or .html in 'Page Editor Options' - Authoring tab, this designates the file extension of new pages.

.htm bug EW 4.0 Only

Replace with your file.Fig 9 - Dialog box asks to replace file

WARNING  - This is a more serious bug

If you were to download a third party .tem Site Template and have .htm set in Page Editor Options - Authoring Tab, then Expression Web 4.0 will proceed to:

  1. RENAME the first file in the list of files, from whatever it is named to default.html
  2. A dialog box will appear (see Fig 8) asking "A file with the name default.htm already exists. Do you want to replace this with your file?"
    1. If you say YES, then EW 4.0 will proceed to delete the next file in the Folder List. It will continue to do this each time you say yes, till all that is left is the changed default.html which is now your homepage.
    2. If you say NO, then it will ask for each file in the list, till it has worked through them all, however the file renamed to default.html remains and is now your homepage.

So my best advice is:

Set this setting to .html till this bug is fixed. All you have to do then is rename your .html files to .htm if that's how you wish them to appear. Once the Site Template is made there are no other problems.

NOTE: This has NOT been fixed in SP1 or SP2 for Expression Web 4.0. Please vote and add your comments if you can replicate this at Microsoft Connect.

Doctype and Secondary Schema

The default settings are:

  • Document Type Declaration - XHTML 1.0 Transitional
  • Secondary Schema - Internet Explorer 7.0 (EW 3.0/4.0 - Internet Explorer 8.0
  • CSS Schema: - CSS 2.1

I recommend you keep these unless you are NOT using XHTML. Though the selection of the browser version depends on weather you have downloaded IE8.0 yet or not, this is something you should change when you start designing and using IE8.0.

Doctypes are the FIRST thing to sort out when looking at old code or designing a new template.

<!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">

The doctype above is for a XHTML Transitional and is the default doctype and what I recommend you use. With the settings outlined above that is what will appear when you make a new page. If you don't have a doctype then you can expect your pages to render in the browser in 'quirks' mode, which is exactly as the name suggests, you never know what you are going to get.

Fig 6 - HTML 5 Doctype Snippet.

Fig 10 - HTML 5 Doctype Snippet

If you are a more advanced user you might want to use the new HTML 5 doctype.  EW 4.0 does not carry the HTML 5 doctype by default but you can easily add it in. Go to Tools - Page Editor Options - Snippets Tab - Press Add and enter a Description and keyword and the doctype code in the pane below and press ok twice, now it will be available. (see Fig 10 for DocType code) Providing IntelliSense is turned on, just press Control + Enter in Code view at the top of the page and a list of snippets for the doctypes will appear.

NEW In Expression Web 4.0 SP2

  1. The HTML 5 doctype is now available by default. The snippets tab in Page Editor Options has now been replaced by a Snippets Panel, however the same shortcut still makes the Snippets Panel appear EVEN when turned off, just press Control + Enter in Code View and the Snippets Panel will appear. Position your cursor at the top of the page in Code View then select the Doctypes folder, select HTML 5 and either right click and choose Apply Snippet or double click to insert the doctype.
  2. You can select the new HTML 5 for every new page automatically by using Page Editor Options Authoring Tab and under Document Type Declaration click the drop down and you can select HTML 5 doctype.
  3. You can also select CSS3 draft from the CSS Schema

You can check for errors in the page when you implement your doctype providing you have set them in the General Tab Tab. For a more comprehensive overview use Tools - Compatibility Reports.

Resources for Character Set and BOM

Revised Sept 2011

Now Available: NEW: View a Web Site Summary - SuperPreview Online - Snapshot


Tina Clarke Signature.
Cheshire Web Designs - Cheshire website Designs by Any Expression Web Designs
Owner Any Expression Web Designs and Clarke Abstract Art

Copyright © 2006 - 2011 Tina Clarke of Any Expression Web Designs All Rights Reserved

Are you looking for a Web Designer?
Web Designs created by Any Expression Web Designs