Working with Templates

From Documentation
Jump to: navigation, search

Working with Templates

A template is a predefined set of pages and assets that you can modify to meet your needs. Templates can contain a single page, a site section, or an entire site. You can edit a template, create a new site from a template, or add a template to an existing site.

You can export your NetObjects Fusion site as a template so you can share your work with other NetObjects Fusion developers or move your site to another computer system.

NetObjects Fusion template files are .zip files. Zip files provide a convenient way to group and compress files. Each template .zip file contains a TemplateName.nft file and all the folders required to build a site based on the template. Do not change the content of the .zip file. NetObjects Fusion depends on the structure of the file to find assets when opening the template. If you try to open a .zip file that is not a NetObjects Fusion template file, you see an error message and NetObjects Fusion will not open the file.

Templates created in certain earlier versions of NetObjects Fusion are .nft files. If you have templates created in an earlier version of NetObjects Fusion, open them in NetObjects Fusion and export them as templates to create a template .zip file.

Creating a Site from a Template

You can use templates that you or your colleagues create and templates created in previous versions of NetObjects Fusion. See Upgrading Your Sites.

  1. To create a new site based on a template, launch NetObjects Fusion and from the File menu of any view, select New Site > From Template.

The Select a Template File dialog appears. The Blank Site and Import templates are in the \AutoSites folder. Do not delete or move these templates. If these templates are not available in this folder, you cannot create a new site or import a site.

  1. Navigate to the folder containing the template you want, select the appropriate TemplateName.zip file, and click Open.

You can also open .nft template files that were created in earlier versions of NetObjects Fusion.

The Save Site As dialog appears.

  1. Enter aname for the new site in the File name field.
  2. Select the location where you want to save the site. By default, NetObjects Fusion saves your site in the \My Documents\NetObjects\NetObjects Fusion\User Sites folder, but you can store it in the location of your choice.
  3. Click Save.

NetObjects Fusion opens in Site view and displays the page icons of the site you created. You can modify the SiteStructure as described in Working with the SiteStructure.

Using Templates to Expand a Site

One way to expand a site is to insert NetObjects Fusion templates in a specific location in your site. Templates are especially helpful if you have standard boilerplate sections or pages that you want to add to multiple sites. This is also a great way to share with other developers who use NetObjects Fusion. See Exporting a Site.

When you insert a template, follow these guidelines:

  • Before you insert the template, select the location in Site view where you want to add it. The inserted site, page, or section becomes a child of the selected page. You can move the pages once they are inserted.
  • All inserted pages take on the SiteStyle of the current site. For example, if several developers separately create parts of a site, export their work as templates, and insert the templates into a single master site for publishing, the master site's SiteStyle ensures that the compiled site has a consistent look and feel. If you save the site as a template, the SiteStyle is saved as well. See Using SiteStyles.
  • When NetObjects Fusion inserts a template, if the MasterBorder names duplicate those already in the site, it prefixes the template's MasterBorders with Inserted and adds them to the current site's library of MasterBorders. You can rename, edit, or delete these extra MasterBorders. See Working with MasterBorders.
  • Every template begins with a single root page, which is helpful if you are adding the template to your site. However, if you want the root page of your template to be the Home page of your site, you must create a new site based on the template, rather than inserting it.

To insert a template:

  1. In Site view, right-click the page under which you want to insert the template. This page becomes the parent of the inserted page or pages.
  2. Select Insert Template from the shortcut menu.

The Insert Template dialog appears.

  1. Navigate to the template you want to insert and select the TemplateName.zip file.
  2. Click Open.

NetObjects Fusion inserts the template under the page you selected. The page data is added to the .nod file and the assets are added to the \Assets folder within the site folder. The original template is still available.

Exporting a Site

You can export any site or selected pages of a site as a template. NetObjects Fusion copies all assets into the \Assets folder of the template in the location you select, and converts absolute paths to relative paths. NetObjects Fusion zips these files and the SiteStyle files and resources for any SiteStyle in use by the source site in the exported template. Exporting a site as a template is the only way to share sites with other NetObjects Fusion developers or to combine sites. You cannot simply copy the .nod file and assets from one computer to another.

Before you export a site as a template, it is a good idea to verify the file assets and then delete unused assets. See Managing File Assets.

To create a template:

  1. In Site view, from the File menu, choose Export as Template.
  2. Select:
    • Entire Site to include all pages in the site in the template.
    • Selected Pages to include only those pages selected in Site view in the template.

The Save Template dialog appears.

  1. Type a name for the template, or accept the name assigned by NetObjects Fusion.
  2. Select the folder where you want to store the template.
  3. If you want the template to include the publish profiles associated with this site, select Include publish profiles.

Be aware that if you select this option and your publish profiles include the password to your site's FTP location, the password will be included in the publish profiles saved with the template.

  1. Click Save.

NetObjects Fusion creates the template file, an \Assets folder, and a \Styles folder and zips them together in a single file. To transfer the template to another computer, you simply move the .zip file.

Changing an Existing Template

You can change or customize any NetObjects Fusion template. For example:

  • You can customize a standard company template so it contains your department name, location, and personnel information.
  • If your company develops custom sites, you can add your company name, contact information, and default links to the templates you use most often.
  • If you often create new pages or sites with the same look and feel, you can add standard objects to the NetObjects Fusion Blank Site template.

To preserve the original template, copy the template .zip file before you edit or modify a default template. If you need to undo changes to a default NetObjects Fusion template, you can re-install NetObjects Fusion.

Customizing a Template

  1. From the File menu, choose New Site > From Template.
  2. In the Select a Template File dialog, select the template you want to customize and click Open.
  3. In the Save Site As dialog, give the site the same name as the template. Do not enter an extension.
  4. Modify the template page(s) and SiteStyle as necessary.
  5. In Site view, from the File menu, choose Export as Template.
  6. Choose the folder containing the original template if you want to modify the template, or choose another location if you want to preserve the original template.
  7. Insert the customized template in other sites as needed.

Sharing NetObjects Fusion Site Files

Templates are the only effective way to share NetObjects Fusion site files among several developers or across platforms. You cannot copy a Sitename.nod file to another computer and open it, because the file refers to files and styles that are not contained in the Sitename.nod file itself.

To distribute or move a NetObjects Fusion site:

  1. Export the site as a template according to the information in Exporting a Site.
  2. Copy the template .zip file to the target computer via network, disk, or other storage media. Locate the template so you do not have to move it after you create the site. This ensures that the assets are mapped correctly. Also make sure the folder and file names are not truncated or changed in the process.
  3. Start NetObjects Fusion on the destination computer.
  4. From the File menu, choose New Site > From Template.

The Select a Template File dialog appears.

  1. Open the template's folder, select the TemplateName.zip file, and click Open.
  2. In the Save Site As dialog, enter a name for the new site in the File name field, select the location where you want to save the site, and click Save.

The site that was created in NetObjects Fusion on the source computer is now the active site, with its own Sitename.nod file, on the destination computer.

If you open a template that uses a font which is not on your system, NetObjects Fusion substitutes the browser proportional font specified on the Text tab of the Options dialog. The original font is available for you to apply to any new text box in the site, but the font is not displayed unless you open the site on a system that has that font.