Relative URLs are used because there are situations where the exact deployment location is not known at the time of content authoring. You know the document structure of the Internet/intranet site to which you are linking, but not the server location. By using a relative URL, you can create the hyperlinks and set the base URL path after publishing.

 

Player Outputs: Updating the Root Location 

The Publishing Wizard uses the location of the Player's index.html file as the base URL path to resolve the relative links; however another base URL path can be specified after publishing.

 

For the Player/LMS and HTML outputs, you can set the base URL path by editing the 'baseUrl" variable located in the config.js JavaScript file in the root of the published PlayerPackage folder (same level as play.exe). After adding the base URL to the JavaScript file, the relative links update during runtime. Updating the base URL in post-processing ONLY applies to relative URLs; there is no impact on absolute URLs.

 

To edit the base URL path, open the config.js file in Notepad and navigate to the "baseUrl" variable. To add the correct base URL, enter the path between single quotes, as shown in the example below.

 

baseUrl='http://wsgserver/en/us';

 

Post-processing the base URL by editing the JavaScript file only applies to Player/LMS and HTML outputs. In LMS deployments, the relative URL must be updated prior to importing the content into an LMS to ensure that the proper path is resolved.

 

Note: You should check the content links after deploying the Player content and linked content on the web server(s).

 

Warning! If JavaScript is turned off, the post-processing does not run and the paths to the relative links cannot be updated.

 

Document Outputs 

Unlike Player outputs, the relative links in published documents are not updatable post-publishing. When you open a published document, only the relative links appear, but the links are active, and can be clicked. The Developer defines the base path (./) for documents as the location where the document is stored and uses that path to resolve the relative URL. Therefore, if you want to be able to use relative links to open a target URL while viewing a document online, the document must be stored in the base URL location of the deployed web content; then the relative links resolve to the correct full URL.

 

If storing the linked content and the documents in the same location on the web server is not possible, another option is to omit the relative links from published documents. All document output styles (System Process, Job Aid, Test Doc, Training Guide, Instructor Manual, Presentation), except the Test Case, have an Include Relative Links publishing option. This option allows you to control whether the links appear in the output.

 

Note: If you want to include links in your documents and you cannot resolve the relative links, you may have to manually edit the links in each document post-publishing with absolute URLs so that they work properly for each document. Another option is to wait until the web content is deployed, and then replace all of the relative URLs in the Developer content with absolute URLs and republish as necessary.


Table of Contents  Back

Publish_Relative_URL_Links