Referencing and Editing External HTML

From Documentation
Jump to: navigation, search

Referencing and Editing External HTML

In addition to content you create and maintain in Page view, your site might also include pages that require special, hand-coded HTML. Instead of importing and converting this HTML, you can reference HTML files externally and place them anywhere in your site.

You can manage the external assets for your referenced file in Assets view. Also, apply a consistent look to the published pages of referenced files by assigning a MasterBorder. You can edit referenced files in HTML Source view or in an external HTML editor. To specify a default external HTML editor, see Setting Program Options.

You can reference files located on a hard disk or LAN, but not from a remote Web server. Also, <A HREF> links in the original HTML files should point to other HTML files and anchors within those files using relative rather than absolute path names. See Managing Referenced Assets for information.

Using Referenced Files

By referencing an external file instead of importing it, you can keep the original file intact and maintain it outside of NetObjects Fusion. When you import a file instead of referencing it, the file becomes a page in the site, and is maintained within NetObjects Fusion.

Referenced files become another page in your site but are maintained separately unless you convert them to NetObjects Fusion. Imported files can be either HTML pages created by someone else or document files that you want to add as text boxes on your page. Once you import a file, you maintain it in your site like any other page.

You can add an external HTML file as:

  • A page that appears exactly as it appears in its original file.
  • A page that appears with your default MasterBorder.
  • An individual object on a page.

See Referencing HTML from Site View and Referencing HTML as an Object.

When you reference an HTML file, NetObjects Fusion copies all of its data to a new HTML file before it is published. The original HTML file remains on your local machine; it is not uploaded to the server when you transfer the site. Because of this, you cannot dynamically update the original file by uploading a new referenced file to the server.

Referencing HTML from Site View

You can reference an entire site or section of a site from Site view. For example, you might reference an existing site you want to manage with NetObjects Fusion now and convert later. Or, you can reference files you prefer to maintain in their native code.

For links to work between the HTML files you reference, use relative path names in the original <A HREF> tags, keep all HTML files in the same directory, and publish files using the same directory structure as the original site. See Managing Referenced Assets for information.

When you reference HTML from Site view, NetObjects Fusion publishes the <HEAD> content from the original files, along with <HEAD> content it generates.

  1. In Site view, select the page to be the parent of the pages you reference.
  2. From the File menu, choose Reference External HTML.

The Reference External HTML dialog appears.

  1. Click Browse.

The Open dialog appears.

  1. Select the top-level HTML file you want to reference, and click Open to return to the Reference External HTML dialog.
  • Assign MasterBorder. Choose a MasterBorder from this drop-down list. Each HTML file you reference occupies the Layout area of a page, while the MasterBorder gives pages the consistent look of your site. To display external content with its original look, choose ZeroMargins. If the HTML contains frames, you must choose the ZeroMargins MasterBorder.
  • Limit number of pages to. Select this option to enter the number of files to reference. NetObjects Fusion begins with the Home page you select and stops referencing when it reaches the end of the site or the number of pages entered here.

NetObjects Fusion only follows <A HREF> links; it cannot follow links in JavaScript or cgi scripts.

  • Down to structural level. Select this option to enter how many levels of your SiteStructure to reference. NetObjects Fusion references as many pages as possible at a higher level before going to a lower level.
  • Do not manage or move assets. If you select this option, NetObjects Fusion doesn't copy external assets into Assets view. Do this if you prefer that path names in the published HTML not be edited from your native code. However, you then have to manage images and other assets yourself. See Publishing Unmanaged Assets.

Referencing HTML from Page View

You can reference an external HTML file as the Layout area of a page from Page view, and incorporate the file's <HEAD> content for example, to include existing META tag keywords or JavaScript definitions.

  1. Create a page in Site view.
  2. In Page view, from the File menu, choose Reference External HTML Page.

The Reference External HTML Page dialog appears.

  1. Click Browse.

The Open dialog appears.

  1. Select the external file you want to reference, and click Open to return to the Reference External HTML Page dialog.

If the file is already referenced elsewhere in the site, avoid creating a duplicate asset by clicking the HTML Assets tab and selecting the file from there.

  1. Choose whether to import the referenced file's <HEAD> content and manage external assets.
  • Import <HEAD>. Select this option to publish the external HTML page's <HEAD> content. Choose Append to Current <HEAD> to add external <HEAD> content to what NetObjects Fusion generates, or choose Replace Current <HEAD> to publish only the external page's <HEAD> content. Note that this setting is not persistent (that is, it is not retained by NetObjects Fusion between sessions), so you must choose this option for each referenced page.

Don't select Replace Current <HEAD> if the page contains actions, navigation bars with rollover buttons, or is being published using the HTML 4.01 output option. NetObjects Fusion generates <HEAD> content these options require.

  • Do not manage or move assets. If you select this option, NetObjects Fusion doesn't copy any external assets into Assets view. Do this if you prefer that path names in the published HTML not be edited from your native code. However, you then have to manage images and other assets yourself. See Publishing Unmanaged Assets.

Referencing HTML as an Object

You can reference an external file as an individual object on a page. For example, you can reference an ad banner, an applet created by a Java, or any other object requiring special code.

You can even reference several external files on a page. For example, you might construct a front page for a company newsletter that includes a slot for each of several externally maintained story leads.

As when you reference HTML as a Layout area, you can incorporate each file's <HEAD> tags and script definitions to include existing META tag and script definitions.

To reference HTML as an object:

  1. In Page view, choose the External HTML tool from the Advanced toolbox.
  2. Draw a box where you want the referenced content to appear.

Put the box in the Layout area to publish the content on one page, or in the MasterBorder to publish it in the border of several pages.

The Reference External HTML Page dialog appears.

  1. Click Browse, select the external file you want to reference, and choose whether to import the file's <HEAD> content and manage external assets, as described in Referencing HTML from Page View.
  2. Click OK.

A placeholder for the referenced HTML file fills the box. Preview the page to see the object. If necessary, go back and adjust the box's position in Page view to get the spacing you want. As with other objects, you can drag a referenced object around the page, drag it inside other objects, or even layer it.

Double-click the referenced HTML placeholder to edit the referenced file in HTML Source view. To edit the file in an external editor, right-click and choose Open File In External Editor from the shortcut menu. To specify a default external HTML editor, see Setting Program Options.

Toggling Referenced Layouts and Objects

You can resize a referenced HTML file so it becomes an object in the Layout instead of taking up the entire Layout area. You can do this to make room for other objects in the Layout area. Conversely, you might want to size a referenced object to fill the entire Layout area. You can also import the referenced object into NetObjects Fusion.

  1. In Page view, click in the referenced Layout area or object you want to resize.
  2. On the General tab of the External HTML Properties panel:
    • Select Size to layout to remove resize handles from an object, which fills the Layout. You can then use the Convert to Fusion button to import the referenced object into NetObjects Fusion.

Avoid sizing a referenced object to a Layout if there are other objects in the Layout area. You might get unexpected results in some browsers.

  • Clear Size to layout to add resize handles to a referenced Layout area, so you can resize it, move it,and add other objects.
  • Click Convert to Fusion to convert the HTML code to Fusion format display.
  • Click Edit HTML File to edit the referenced file on the HTML Source tab.

Managing Referenced Assets

When you reference an external HTML file, NetObjects Fusion lists the HTML file in Assets view. Unless you choose otherwise, it imports into Assets view pictures, applets, media, and most other external assets the file references.

You can move external assets in your directory structure in Publish view while maintaining paths. When you publish, NetObjects Fusion edits paths to the assets so they can be found. For example, depending on your original and published directory structures, NetObjects Fusion might change the original HTML's <IMG SRC="Images/Logo.gif"> to <IMG SRC="../Index/Logo.gif"> in the published HTML.

However, NetObjects Fusion doesn't edit paths to other HTML files, or to target anchors within <A HREF> tags. For these links to be maintained, the path names in the original files must work as-is when you publish. The original <A HREF> tags should use relative rather than absolute path names, for example, use <A HREF="Index.html"> rather than <A HREF="HTTP://www.your_original_domain.com/ Index.html">. You must position external HTML files in your NetObjects Fusion directory structure so the original paths work. See Customizing Your Site's Directory Structure.

NetObjects Fusion manages external assets referenced by these tags:

  • <IMG SRC=>
  • <A HREF=> to non-HTML assets, such as sound files
  • <BODY BACKGROUND=>
  • <EMBED SRC=>
  • <BGSOUND SRC=>
  • <SCRIPT SRC=>
  • <INPUT SRC=>
  • <APPLET CODE=>

Although NetObjects Fusion manages external applets that are assets of referenced HTML, it might not manage certain classes referenced by the applets. Look in Assets view to see if any classes you reference aren't listed. Then see Publishing Unmanaged Assets.

Publishing Native HTML

When you preview or publish referenced HTML, NetObjects Fusion copies the HTML from the original files to a location in the publish folder. Note that some links may not work in Preview. If managing external assets or including MasterBorders, NetObjects Fusion also adds its own code to the published HTML. Of course it never modifies your original files.

If you don't want HTML added to the original code when the site is published, you can choose these options in the Reference External HTML and Reference External HTML Page dialogs.

  • When you reference from Site view, choose the ZeroMargins MasterBorder. NetObjects Fusion doesn't add MasterBorder information to the published HTML or impose a table structure.
  • When you reference from Page view, choose Replace Current<HEAD> from the Import <HEAD> drop-down list. NetObjects Fusion publishes the original <HEAD> as-is, without adding HTML of its own.

Don t do this if you re using actions or navigation bars with rollover buttons on the page, or publishing using the HTML5 output option.

In either case, select Do not manage or move assets. NetObjects Fusion doesn't copy external assets into Assets view, so it doesn't edit path names in the published HTML. However, this means you have to publish images and other assets yourself. See Publishing Unmanaged Assets.

Publishing Unmanaged Assets

If you choose not to manage assets when you reference external HTML files, you have to get external pictures, media files, applets, and other assets to the Web server yourself.

You can upload the files to the server from wherever they reside using an FTP utility. Or, use the New File Asset command to copy assets into Assets view so they are published with the rest of the site.

  1. In Assets view, from the Assets menu, choose New File Asset.

The File dialog appears.

  1. Click Browse in the dialog to open an external asset you want to publish, and type a name for the asset. See Adding a File Asset.
  2. Select Always publish file and click OK.

This causes the file to be published, even though it's not listed as being in use.

  1. In Publish view, position the asset in your directory structure so when it's published, it can be found by any HTML page referencing it.

Because paths to unmanaged assets aren't edited in the published HTML, you must position assets so the original paths work. See Customizing Your Site's Directory Structure.