Example: Defining New Tags

In this example you will make a new heading tag called "<HEADER>" with the following attributes:

ALIGNMENT = LEFT|RIGHT|CENTER (Enumerated value)

SIZE=Integer

REF=URL (i.e., location of a file (say))

Remember: This HEADER tag will not do anything to your browser. All you are doing is making PageWiz accept the HEADER tag as valid syntax. The Syntax Tag Manager is mainly used by companies that have their own tags defined for use by their custom browsers.

Step 1. Open the Syntax File Manager

On the View menu, select "Resource Manager".

In the Resource Manager sub-menu, click "HTML Tags".

Click the ‘Add/Edit Tags’ button graphics/Hotdog500000052.gif

Step 2. Load the User Tags Syntax File

  1. Click the Load Syntax File Button, graphics/Hotdog500000053.gif.

  2. Double click the ‘user.stx’ file.

This opens the user defined syntax file ready for editing. If you haven’t already defined some of your own tags, the syntax file will be empty. However, the ‘Syntax File Description’ (on the top right of the Syntax File Manager) will read ‘User Defined’.

Step 3. Set the Syntax File Description

The Syntax File Description appears in the tag filter. It allows easy identification of your syntax files.

Step 4. Creating a Attribute Template

Attribute Templates are lists of attributes that you commonly use. For example, the ALIGN=”LEFT|RIGHT|CENTER” is a common attribute. Rather than re-typing this attribute all the time, you can define it once and just drag it across to your Tag. In this example, you are going to create an ALIGN attribute template.

To begin, create a dummy tag to hang all your attributes off.

  1. Click on the Attribute Templates window.

  2. Click on ‘New Template’.

  3. Under ‘Name’ enter: ‘DUMMYTAG’.

  4. Click ‘Add >>’.

Now add the ALIGN attribute to this tag.

  1. In the Attribute Templates window, click on DUMMYTAG.

  2. Click on ‘Add Attribute’.

  3. Under ‘Name’ enter: ‘ALIGN’.

  4. Under Type click ‘Enumerated’.

  5. Click ‘Add >>’.

This adds the ALIGN attribute to the Attribute Template. Now add some values to the attribute.

  1. Click on the ALIGN attribute in the Attribute Templates window. This brings the ALIGN attribute to focus.

  2. Click ‘Add Enum Value’.

  3. Under ‘Name’ enter ‘LEFT’.

  4. Click ‘Add >>’.

  5. Click on the ALIGN attribute in the Attribute Templates window. This brings the ALIGN attribute to focus.

  6. Click ‘Add Enum Value’.

  7. Under ‘Name’ enter ‘RIGHT’.

  8. Click ‘Add >>’.

  9. Click on the ALIGN attribute in the Attribute Templates window. This brings the ALIGN attribute to focus.

  10. Click ‘Add Enum Value’.

  11. Under ‘Name’ enter ‘CENTER’.

  12. Click ‘Add >>’.

This completes the construction of the ALIGN Template. A description of its use is below.

Step 5. Defining the description of the attributes

When using PageWiz you will have noticed that when you hold the mouse over a tag or attribute, a description of that tag or attribute pops up. You can create your own descriptions here. For example, when a users holds the mouse over your ALIGN tag, you could pop up a message: ‘Aligns the header left, right or center’.

To do this:

  1. Click on the ALIGN attribute in the Attribute Templates window.

  2. In the description box, enter ‘Aligns the header left, right or center’.

Step 6. Adding the HEADER Tag

Now it is time to add the HEADER tag to your syntax list.

  1. Click on the Syntax File Tags window.

  2. Click ‘New Tag’.

  3. Under Name type ‘HEADER’.

  4. Click ‘<< Add’.

Step 7. Adding the Align Attribute

Adding the ALIGN Attribute is easy.

The ALIGN attribute is automatically entered into the HEADER tag.

Step 8. Adding the Size Attribute

  1. Click the HEADER tag in the Syntax File Tags window.

  2. Click ‘Add Attribute’.

  3. Under ‘Name’ type ‘SIZE’.

  4. Under ‘Type’, select ‘Integer’.

  5. Click ‘Add <<’.

This means PageWiz will only recognize integer values for the SIZE attribute.

Step 9. Adding the REF attribute

  1. Click the HEADER tag in the Syntax File Tags window.

  2. Click ‘Add Attribute’.

  3. Under ‘Name’ type ‘REF’.

  4. Under ‘Type’, select ‘URL’.

  5. Click ‘Add <<’.

This means PageWiz will only recognize a URL value for the Cap attribute.

Step 10. Saving the updated syntax file.

Congratulations!!! -- You have now completely defined your own tag.

Open a new web page, and type the HEADER tag. PageWiz will recognize it!!!

If you are using the HTML Property Sheet or the HTML Tags Manager you will notice that your tag’s attributes are ready to go.