Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Usability

  • Print
  • + Share This
Like this article? We recommend

Adding a New Category Entry

The Categories key contains child keys for each type of page template and child keys for each theme’s template within that type. To create a new theme, you need to locate each of the category child keys (those for each template type) and create a new child key within each of them that describes the appropriate template file of your new theme. To do this, you have to know both the name of your new theme and the naming scheme that you will use to create each of the template files.

Choosing a name for the theme is completely up to you. The naming scheme for the files is also up to you, but I suggest sticking with Apple’s naming scheme. This scheme consists of the theme name, a space, the name of the page type, and then .webtemplate. So for Apple’s Elegant theme, the About Me template file’s filename would be Elegant About Me.webtemplate.

If you are working in a text editor, you can locate the keys fairly easily because the file is formatted with each child key being indented from its parent key. You can see this in Figure 1, in which the first primary key, Categories, has a single indent, the About Me key is indented further, and the child key that identifies what this key is for is indented again. Beyond that are the actual theme keys, which are indented once more.

To add another theme child key to the About Me key, you can most easily copy and paste an existing key (the text of which is indicated in the code sample below), rename the name of the theme between the first set of <key> and </key> tags, and then rename the template file name between the last set of <string> and </string> tags in the key segment. (Remember that you need to do this for each of the category types.)

  <key>Elegant</key>
       <dict>
         key>displayName</key>
         <string>About Me</string>
         <key>fileName</key>
         <string>Elegant About Me.webtemplate</string>

After you finish the Categories key additions, you can skip down to the SortedThemes key (which is the last primary key in the file). This key identifies the key names for each theme, as referenced earlier in the plist file, and the display name used in iWeb’s New Page dialog box. It also identifies how the theme is displayed under the iWeb theme version menu in the New Page dialog box.

Again, when using a text editor, the easiest solution is to copy, paste, and then edit an existing child key entry. What you need to edit is the name of the theme between the first and second sets of <string> and </string> tags. It is important to use the same theme name that you used earlier with the Category key entries. Below is an example of the code that makes up a Sorted Themes child key entry.

  <dict>
      <key>displayName</key>
      <string>Elegant</string>
      <key>keyName</key>
      <string>Elegant</string>
      <key>version</key>
      <string>1.1 Themes</string>
    </dict>

If you copy and paste from an iWeb 1.0 theme and do not adjust the contents or the final set of <string> and </string> tags, the theme will be displayed with other iWeb 1.0 themes. You can also add a different entry here, such as My Themes to create another menu item for your themes (although it might not function properly in iWeb 1.0 or in future iWeb versions).

If you are familiar with using the Property List Editor application, you can make each of these additions by using it. However, because the Property List Editor lacks the capability to copy and paste key information, you will need to manually create each child key, set its attributes, and create the child keys within it that define values. You can use the existing keys as a guide for the proper key syntax. If you are not used to the Property List Editor, however, you’ll probably find it easier to use a text editor to make these changes.

  • + Share This
  • 🔖 Save To Your Account