7 Working With Links

One task you perform as a contributor is creating hyperlinks. Hyperlinks are a great way to take site visitors from one web page to another on your site or to other Web sites. Hyperlinks are especially useful to refer visitors to another web page or site where a particular subject is explained in more detail.

This section covers the following topics:

7.1 About the Link Wizard

You use the Link wizard in Contributor to create or edit hyperlinks to other sections of your site, to contributor data files and native documents on your site, to other sites in the content server, and so on.

The Link wizard takes you through all variations on linking:

7.2 Creating a Link to Another Section of the Web Site

To create a link to another section of your Web site or another Site Studio site on the content server, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-1) in the toolbar.

    Figure 7-1 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Select Link to a section.

  4. Click Next.

    Note:

    You can step through the wizard faster by clicking the blue arrow to the left of the option you want to use. This automatically selects the option and moves the wizard to the next step.
  5. Choose the section that you would like to link to. This can be a a section on the current Web site or a different Site Studio site on the content server. You select the target section in the site hierarchy.

  6. Click Next.

  7. Depending on the site configuration, you may be prompted to choose the URL format of the link:

    • Path-based URL: The link will contain a path to the target location. You have two choices for this type of link:

      • Absolute Path: Generates a full path; for example <!--$ssServerRelativeSiteRoot-->products/index.htm (where "<!--$ssServerRelativeSiteRoot-->" gets replaced with the path to the root of the Web site).

      • Relative Path: Generates a relative path instead of a full path; for example ../products/index.htm.

      Please note that this option is not available if you chose to use the default Web site section for the content file as the target section (see previous step).

    • ID-based URL: The link will contain the coded identity of the target location rather than the path-based name. You have three choices for this type of link:

      • Client Side Script Format: Uses client-side JavaScript to construct a link to the target location; for example, javascript:nodelink('10024');.

      • Server Side Script Format: Uses server-side Idoc Script to construct a link to the target location; for example, [!--$wcmUrl('nodelink','10024')--].

      • URL Token Format: Uses a redirect on the server to construct a link to the target location; for example, ssNODELINK/10024.

    Note:

    You may not see the URL format page, depending on whether the site designer chose to allow contributors to make this decision. Ask your site designer for assistance if you are unsure which URL format to pick.
  8. Click Options.

    The Link Target Options dialog is displayed.

  9. If you want the link to open in a new web browser window when clicked, select the Open link target in new window check box, and then choose the target in the menu (_blank). You can also directly enter the name of the target in the text box if you want, but if it is not a valid target, the link will be faulty.

  10. Click OK or Cancel to return to the wizard.

  11. Click Next.

  12. Verify the URL for the link.

  13. Click Finish.

7.3 Creating a Link to a New Content File

You can create a link to a new content file (contributor data file or native document), which will be checked into the content server as a managed site asset.

To create a link to a new content file, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-2) in the toolbar.

    Figure 7-2 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Select Link to a file.

  4. Click Next.

    Note:

    You can step through the wizard faster by clicking the blue arrow to the left of the option you want to use. This automatically selects the option and moves the wizard to the next step.
  5. Select either New Contributor data file or New native file, depending on which type of file you want to add. For a new native document, also select the file format from the menu. The site designer decides what file formats are allowed for new native documents. (See also "Considerations When Creating a Link to a File".)

  6. Click Next.

    The standard content check-in page on the content server is displayed.

  7. Enter the appropriate content information (metadata) to check the item into the content server. Much of the information will be automatically provided. If a field name is marked red, then the field is required (that is, the item cannot be checked in if the field is empty). Please note that the new contributor data file or native document will be empty until a site contributor (you or someone else) edits it.

    Click Next when you have finished.

  8. Choose the target section for the link. You can choose from the following options:

    • Use default website section metadata: If you choose this option, the hyperlinked content file will display in the Web site section as currently specified in the Web Site Section metadata field for the content file. If the site designer allows contributors to select the URL format of links, you must use an ID-based URL format (see next step).

    • Choose a website section: If you choose this option, the hyperlinked content file will display in the Web site section of your choice (in effect overriding the default target section of the content file). The section may be in the current Web site or another Site Studio site on the content server.

    • Link to the Content Item's URL: If you choose this option, the file will display exactly as it is stored on the content server rather than within the framework of the Web site. This is useful for linking to native documents such as PDF files.

    Click Next to continue.

  9. Depending on the site configuration, you may be prompted to choose the URL format of the link:

    • Path-based URL: The link will contain a path to the target location. You have two choices for this type of link:

      • Absolute Path: Generates a full path; for example <!--$ssServerRelativeSiteRoot-->Menus/switched_region_CDF (where "<!--$ssServerRelativeSiteRoot-->" gets replaced with the path to the root of the Web site).

      • Relative Path: Generates a relative path instead of a full path; for example ../Menus/switched_region_CDF.

      Please note that this option is not available if you chose to use the default Web site section for the content file as the target section (see previous step).

    • ID-based URL: The link will contain the coded identity of the target location rather than the path-based name. You have three choices for this type of link:

      • Client Side Script Format: Uses client-side JavaScript to construct a link to the target location; for example, javascript:link('switched_region_CDF');.

      • Server Side Script Format: Uses server-side Idoc Script to construct a link to the target location; for example, <!--$wcmUrl("link","switched_region_CDF")-->.

      • URL token format: Uses a redirect on the server to construct a link to the target location; for example, ssLINK/switched_region_CDF.

    Note:

    You may not see the URL format page, depending on whether the site designer chose to allow contributors to make this decision. Ask your site designer for assistance if you are unsure which URL format to pick.
  10. Click Options.

    The Link Target Options dialog is displayed.

  11. If you want the link to open in a new web browser window when clicked, select the Open link target in new window check box, and then choose the target in the menu (_blank). You can also directly enter the name of the target in the text box if you want, but if it is not a valid target, the link will be faulty.

  12. Click OK or Cancel to return to the wizard.

  13. Click Next.

  14. Verify the URL for the link.

  15. Click Finish.

7.4 Creating a Link to an Existing File on the Content Server

You can create a link to an existing content file (contributor data file or native document) on your site or another site in the content server.

To create a link to an existing file on the content server, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-3) in the toolbar.

    Figure 7-3 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Select Link to a file.

  4. Click Next.

    Note:

    You can step through the wizard faster by clicking the blue arrow to the left of the option you want to use. This automatically selects the option and moves the wizard to the next step.
  5. Select Existing file from server, and click Next.

    The standard search results page on the content server is displayed, showing all content files that are available for you to choose. The site designer decides what criteria are used for the search query.

    See also "Considerations When Creating a Link to a File".

  6. Click Select next to the file you want to link to.

  7. Choose the target section for the link. You can choose from the following options:

    • Use default website section metadata: If you choose this option, the hyperlinked content file will display in the Web site section as currently specified in the Web Site Section metadata field for the content file. If the site designer allows contributors to select the URL format of links, you must use an ID-based URL format (see next step).

    • Choose a website section: If you choose this option, the hyperlinked content file will display in the Web site section of your choice (in effect overriding the default target section of the content file). The section may be in the current Web site or another Site Studio site on the content server.

    • Link to the Content Item's URL: If you choose this option, the file will display exactly as it is stored on the content server rather than within the framework of the Web site. This is useful for linking to native documents such as PDF files.

    Click Next to continue.

  8. Depending on the site configuration, you may be prompted to choose the URL format of the link:

    • Path-based URL: The link will contain a path to the target location. You have two choices for this type of link:

      • Absolute Path: Generates a full path; for example <!--$ssServerRelativeSiteRoot-->Menus/switched_region_CDF (where "<!--$ssServerRelativeSiteRoot-->" gets replaced with the path to the root of the Web site).

      • Relative Path: Generates a relative path instead of a full path; for example ../Menus/switched_region_CDF.

      Please note that this option is not available if you chose to use the default Web site section for the content file as the target section (see previous step).

    • ID-based URL: The link will contain the coded identity of the target location rather than the path-based name. You have three choices for this type of link:

      • Client Side Script Format: Uses client-side JavaScript to construct a link to the target location; for example, javascript:link('switched_region_CDF');.

      • Server Side Script Format: Uses server-side Idoc Script to construct a link to the target location; for example, <!--$wcmUrl("link","switched_region_CDF")-->.

      • URL token format: Uses a redirect on the server to construct a link to the target location; for example, ssLINK/switched_region_CDF.

    Note:

    You may not see the URL format page, depending on whether the site designer chose to allow contributors to make this decision. Ask your site designer for assistance if you are unsure which URL format to pick.
  9. Click Options.

    The Link Target Options dialog is displayed.

  10. If you want the link to open in a new web browser window when clicked, select the Open link target in new window check box, and then choose the target in the menu (_blank). You can also directly enter the name of the target in the text box if you want, but if it is not a valid target, the link will be faulty.

  11. Click OK or Cancel to return to the wizard.

  12. Click Next.

  13. Verify the URL for the link.

  14. Click Finish.

7.5 Creating a Link to an Existing Local File

You can create a link to an existing local file (that is, on your own computer), which will be checked into the content server as a managed site asset.

To create a link to an existing local file, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-4) in the toolbar.

    Figure 7-4 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Select Link to a file.

  4. Click Next.

    Note:

    You can step through the wizard faster by clicking the blue arrow to the left of the option you want to use. This automatically selects the option and moves the wizard to the next step.
  5. Select Existing local file, and click Next.

    The standard content check-in page on the content server is displayed.

    See also "Considerations When Creating a Link to a File".

  6. Enter the appropriate content information (metadata) to check the item into the content server. Much of the information will be automatically provided. If a field name is marked red, then the field is required (that is, the item cannot be checked in if the field is empty). Use the Browse button next to the Primary File field to navigate to the file on your computer and select it. Also, make sure to specify a title.

    Click Next when you have finished.

  7. Choose the target section for the link. You can choose from the following options:

    • Use default website section metadata: If you choose this option, the hyperlinked content file will display in the Web site section as currently specified in the Web Site Section metadata field for the content file. If the site designer allows contributors to select the URL format of links, you must use an ID-based URL format (see next step).

    • Choose a website section: If you choose this option, the hyperlinked content file will display in the Web site section of your choice (in effect overriding the default target section of the content file). The section may be in the current Web site or another Site Studio site on the content server.

    • Link to the Content Item's URL: If you choose this option, the file will display exactly as it is stored on the content server rather than within the framework of the Web site. This is useful for linking to native documents such as PDF files.

    Click Next to continue.

  8. Depending on the site configuration, you may be prompted to choose the URL format of the link:

    • Path-based URL: The link will contain a path to the target location. You have two choices for this type of link:

      • Absolute Path: Generates a full path; for example <!--$ssServerRelativeSiteRoot-->Menus/switched_region_CDF (where "<!--$ssServerRelativeSiteRoot-->" gets replaced with the path to the root of the Web site).

      • Relative Path: Generates a relative path instead of a full path; for example ../Menus/switched_region_CDF.

      Please note that this option is not available if you chose to use the default Web site section for the content file as the target section (see previous step).

    • ID-based URL: The link will contain the coded identity of the target location rather than the path-based name. You have three choices for this type of link:

      • Client Side Script Format: Uses client-side JavaScript to construct a link to the target location; for example, javascript:link('switched_region_CDF');.

      • Server Side Script Format: Uses server-side Idoc Script to construct a link to the target location; for example, <!--$wcmUrl("link","switched_region_CDF")-->.

      • URL token format: Uses a redirect on the server to construct a link to the target location; for example, ssLINK/switched_region_CDF.

    Note:

    You may not see the URL format page, depending on whether the site designer chose to allow contributors to make this decision. Ask your site designer for assistance if you are unsure which URL format to pick.
  9. Click Options.

    The Link Target Options dialog is displayed.

  10. If you want the link to open in a new web browser window when clicked, select the Open link target in new window check box, and then choose the target in the menu (_blank). You can also directly enter the name of the target in the text box if you want, but if it is not a valid target, the link will be faulty.

  11. Click OK or Cancel to return to the wizard.

  12. Click Next.

  13. Verify the URL for the link.

  14. Click Finish.

7.6 Creating a Link to a URL

You can create a link to a specific URL (web address); for example, an Internet Web site or a file on the content server (one not used for contribution, such as a PDF file, media file, or zip file).

To create a link to a specific URL, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-5) in the toolbar.

    Figure 7-5 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Select Link to following URL.

  4. Enter the web address in the field provided (for example, http://www.example.com).

    You cannot proceed in the wizard until you provide a URL.

  5. Click Options.

    The Link Target Options dialog is displayed.

  6. If you want the link to open in a new web browser window when clicked, select the Open link target in new window check box, and then choose the target in the menu (_blank). You can also directly enter the name of the target in the text box if you want, but if it is not a valid target, the link will be faulty.

    Note:

    When creating a link to another Web site, the "Open link target in new window" option may be useful because it prevents users from inadvertently leaving your Web site when they click the link.
  7. Click OK or Cancel to return to the wizard.

  8. Click Next.

  9. Verify the URL for the link.

  10. Click Finish.

7.7 Editing Links

After you create a link in Contributor, you can then edit the link at any time. You can change the way the link works on your site, or you can edit the file that the link points to (the target file):

7.7.1 Editing a Hyperlink

You can edit an existing link by placing the cursor on the link and then re-launching the Link wizard. You can use the wizard to change any part of the link.

To edit a link, perform these tasks:

  1. Highlight the text (or image) that you would like to turn into a link.

  2. Click the Create Hyperlink icon (Figure 7-6) in the toolbar.

    Figure 7-6 Create Hyperlink Icon

    Create Hyperlink icon

    The Link wizard is launched (see "Link Wizard").

  3. Follow the same steps that you would to create a link, making changes where appropriate. For more information, see:

  4. Close the Link wizard.

7.7.2 Editing a Link Target

If you have created a link that points to another file, then you can edit the contents of that file (the "link target").

To edit the target file of a hyperlink, perform these tasks:

  1. Place your mouse cursor anywhere in the hyperlinked text (or highlight the text).

  2. Choose the Edit Link Target icon (Figure 7-7) in the toolbar.

    Figure 7-7 Edit Link Target Icon

    Edit Link Target icon
  3. One of two things happen:

    • If the link target is a contributor data file, a window opens showing the link target, and then the Contributor editor opens, so you can edit that file.

      Edit the file as you normally would in Contributor. When you click the save icon, the file is checked into the content server, and the editor will close.

    • If the link target is a native document, the file opens in the third-party application that is associated with the native file format (for example, Microsoft Word for .doc files). You may need to confirm the installation of a small program that enables this "check-out-and-open" functionality.

      Edit the file as you normally would in that application. When you save and close the file, it is checked into the content server and converted into a web-viewable format (typically, HTML).

  4. You return to the page that you were working on in Contributor.

    You can also edit a link target in a dynamic list (see "Editing the Files in a Dynamic List").

7.8 Removing a Link

After you add a link using the Link wizard, you can easily remove it at any time, by performing these tasks:

  1. Place your mouse cursor anywhere in the hyperlinked text (or highlight the text).

  2. Click the Remove Hyperlink icon (Figure 7-8) in the toolbar.

    The hyperlink is removed from the text.

    Figure 7-8 Remove Hyperlink Icon

    Remove Hyperlink icon

7.9 Considerations When Creating a Link to a File

When you create a hyperlink to another file, you can choose to link to a contributor data file or a native document. You can link to an existing file on the site, or you can link to a new file that you create along the way. These are some things you should consider when creating links:

Contributor Data File Versus Native Document

A contributor data file is a file that is generated by Site Studio Contributor and viewed and edited using the Contributor application. A native document, however, is any file created by a third-party application (such as Microsoft Word, Excel, or PowerPoint), which is converted into the web-viewable HTML format using Dynamic Converter.

Both files can be used on a Site Studio Web site. Both become web pages on the Web site, and in fact, you probably will not be able to tell a web page that is derived from a contributor data file from a web page that is derived from a native document.

The difference is in how you edit them. You open and edit contributor data files using the Contributor application, which is a powerful and flexible tool to edit web pages. You open and edit native documents using a third-party application (the actual application depends on the type of file you are editing).

Reusing Data Files and Relative Paths

If you are reusing the same contributor data file in different places in your Web site, you should avoid using relative paths in your links, because the relative path may change depending on where the file is being used on the Web site.

New Files Result in New Web Pages

If you have spent much time working on other Web sites, you are probably familiar with the concept of linking to an existing web page, or file. If, for example, there is a page called "news.htm" and you want to reference it from the page you are working on, you create a link to that file.

However, if the file does not exist and you know you must create one, then you can use the Link wizard in Contributor to create the link and create the file at the same time. By adding the new file, you are effectively adding a new web page to the Web site. Therefore, using the Link wizard is not only useful for creating links, but it also the easiest way to add web pages to the Web site. (The other way is to add a file to a dynamic list, as described in "Adding a New File to a Dynamic List" and "Adding an Existing File to a Dynamic List".)

Note:

The Link wizard is available only in Contributor and Designer. You do not have such flexibility with hyperlinks when you are working with native documents in a third-party application.

Understanding Target Sections

When creating a hyperlink to a file (contributor data file or native document), one choice you have is to specify the section where that file should appear on the Web site when the link is clicked. This is also referred to as a "target section."

This is a special feature because you can control where a particular file appears on the Web site regardless of where it is actually stored on the site. For example, if you have a product description stored in the "Products" section of the site, you can create a link to it from the "Support" section and then specify that the document actually appears in the "Support" section when the hyperlink is clicked.

This becomes even more pronounced when you create a link to another file stored on another site or a file that is not associated with any Web site on the content server. Even though that file is not formally part of your site, you can create a link to it and specify that it appear in a section on your site when the link is clicked. (Or, you could do the opposite and create a link to a file on your site but make it appear on another site in the content server.)

This feature is particularly powerful where you want to reuse the same file in different ways on different Web sites.

How Site Studio Contributor Determines the Target Section

If you frequently create hyperlinks in Contributor, it is useful to understand the logic that Site Studio uses when determining where to display a particular file. There is essentially a three-rule evaluation that is performed, and it goes as follows:

  1. If you (as the contributor) specify a target section for the file in the Link wizard, then the file appears in that section.

  2. If you choose "Use default website section metadata" in the Link wizard, then the file appears in the section where it is stored on the Web site.

  3. If you choose "Use default website section metadata" in the Link wizard, but the file is not stored in a section on the Web site, then the file appears in the same section where the original hyperlink is located. This is also the case if you do not specify anything.