Using components


    You use GoLive components in your pages to reference one or more elements stored in a single source file. Components are useful for buttons, logos, headers, mastheads, or other common navigation elements that you want to use throughout your site. Changes you make to elements in a component's source file are updated dynamically in the pages that use the component.

    When you add a component to a page, the component remains linked to its source file until you detach it. You can double-click components on the page to open their source files and edit the files. You can save components with a specific site, or as application-wide components.

    Note: Components cannot contain objects from the Head set in the Objects palette. Also, you should make sure to use the same character encoding for a component's source file as the character encoding in the pages that use the component. (See Adding elements or scripts to the head section.)

To create a component source file:

  1. In a new document window, add the desired content for the component--for example, a layout grid with your corporate logo and headline--and then click the Show Page Properties icon Show Page Properties icon in the upper right corner of the window.
  2. In the Page Inspector, click the HTML tab, select Write Code into Page, and then click Component to set up the current page for use as a dynamic component.
  3. This ensures that the component can be easily edited in the Layout Editor. The Import GoLive Script Library setting is necessary if your component uses GoLive actions.

  4. Open the site window and do any of the following to save the page as a component:
    • Choose File > Save As, name the component, choose Components from the Site Folder menu, and click Save.
    • Choose Save As > Save As Component from the document window menu, name the component, and click Save.
    • In the site window, drag the page from the Files tab to the Components folder in the Extras tab, or to the site-specific or application-wide section of the Components tab in the Library palette.

    Note: Site-specific components are stored in the site's web-data/Components folder and appear in the Components tab of the Library palette and the Extras tab of the site window.

To use a component:

    Do one of the following:

    • Drag the component's icon from the Components tab of the Library palette to the page.
    • From the Smart set in the Objects palette, drag the Component placeholder icon to the page. Then, in the Component Inspector, specify the destination of the link by dragging from the pick whip to the component's source file in the Extras tab in the site window.

To edit the component's source file:

  1. Double-click the component on the page to open the source file.
  2. Make the desired changes and save the source file.
  3. Click OK to update all pages that use the component.
  4. Note: Components are updated only while you work on your local hard disk. To update components on the Web server, you must upload each component's source file and also the pages that use the component to update your site after changing a source file.

To detach a component from its source file:

    Select the component on the page, choose Special > Detach Selected Component, and then click OK. You can detach all components on the page by choosing Special > Detach All Components.

    The detached component is now fully a part of the page with no dependent link to the source file--changing the source file will no longer affect the detached component in the page.