Create Perfect Pretty URLs - Fluid Topics

Category
How To
Audience
public

Overview

Business need

Pretty URLs replace original URLs and offer the following advantages:

  • Pretty URLs remain stable even as documents change over time, thus eliminating the risk of sharing a dead link.
  • Pretty URLs are more meaningful and easier for users to understand.
  • From an SEO perspective, search engines use Pretty URLs in the same way as original URLs.
  • Pretty URLs are easy to read in Google Analytics or in any other analytics platform that uses URLs.

Overview of the solution

Creating perfect Pretty URL templates requires long-term thinking and a clear set of objectives. Well-designed Pretty URLs can withstand changes throughout the content lifecycle.

Pretty URL templates can include any metadata that makes a document or topic unique, such as its title, version, minor versions, language, audience, etc.

Content managers can create multiple templates for different content types, such as topics, attachments, unstructured documents, etc.

Procedure

This section describes how to define perfect Pretty URL templates and provides examples.

If anything in this section seems unclear, please refer to Pretty URL topic in the Fluid Topics Configuration and Administration Guide and explore our additional Pretty URL resources.

Step 1. Define the template

Use one or both of the following elements:

  • Metadata key(s) placed between curly brackets.
  • Static text.

Separate each key or section of text with a dash (-), an underscore (_), or a slash (/), as in the following example: doc_{FT_version}/{ft:title}

Step 2. (Optional) Add metadata prefixes.

Administrators can use the following metadata prefixes to customize Pretty URLs.

  • The document. metadata prefix references the document's metadata.
  • The parents-and-self metadata prefix concatenates the metadata of all parent topics and the current topic, creating a breadcrumb.
If the structure of your content is likely to change, define a template using a topic identifier and other metadata instead of adding the `parents-and-self` metadata prefix.

Step 3. (Optional) Add metadata requirements.

It is posisble to apply a Pretty URL template only to content with specific metadata.

Step 4. Specify template hierarchy.

The Fluid Topics pretty URL generator tries to apply templates in the order in which they are listed in the Pretty URL administration interface. For this reason, it is recommended to place more specific templates (e.g., a template with metadata restrictions) at the top of the list and less specific ones (e.g., a "catch all" template) at the bottom.

Fluid Topics only applies a template to documents that include all the metadata specified in the template. When this requirement is not met, Fluid Topics attempts to apply the next template in the hierarchy.

Step 5. Apply templates.

There are two methods to apply the Pretty URL templates.

  • Selecting Activate for all documents in the Pretty URL administration interface triggers a reprocess job and applies the Pretty URL templates to the documentation. Any content a user uploads while a reprocess job is underway is queued and processed after the reprocess job is complete.
  • Selecting Save and activate in the Pretty URL administration interface only applies the templates to future uploads. This option serves multiple purposes:

    • It prevents previously generated Pretty URLS from breaking.
    • It lets administrators test a template without affecting previously published content (reprocessing is not required).

Examples

Example 1

An administrator wants to display documents where Category=Manual as /Manual/{document title}.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select an empty template (or select Add template) in the Pretty URLs for documents section.
  3. Define the template as follows: /Manual/{ft:title.
  4. Select Add metadata requirement.
  5. Select the Category metadata and the Manual value.
  6. Select Save.
  7. Select either Activate for all documents or Save and activate.

Example 2

An administrator wants to display all PDF files as /PDF/{document title}.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select an empty template (or select Add template) in the Pretty URLs for documents section.
  3. Enter the following as the template: /PDF/{ft:title}.
  4. Select Add metadata requirement.
  5. Select the ft:mimeType metadata and the application/pdf value.
  6. Select Save.
  7. Select either Activate for all documents or Save and activate.

Example 3

An administrator wants all topics to include the parent document title.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select an empty template (or select +Add template) in the Pretty URLs for topics section.
  3. Enter the following as the template: {document.ft:prettyURL}/{parents-and-self.ft:title}.
  4. Select Add metadata requirement.
  5. Select the Category metadata and the Manual value.
  6. Select Save.
  7. Select either Activate for all documents or Save and activate.

Example 4

An administrator wants the same Pretty URL for the most recent version of a document. Previous versions of the document will have fixed URLs after publishing.

For this example, the latest version is 4 and previous versions are 1, 2, and 3.

Template hierarchy is important, as explained in the Overview section.

Step 1. Create the Pretty URL template for the latest version of the document.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select an empty template (or select Add template) in the Pretty URLs for documents section.
  3. Enter the following as the template: {ft:title}.
  4. Select Add metadata requirement.
  5. Select the Version metadata and the 4 value.
  6. Select Save.
  7. Select either Activate for all documents or Save and activate.

Step 2. Create the Pretty URL template for all previous versions of the document.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select +Add template in the Pretty URLs for documents section.
  3. Enter the following as the template : {version}/{ft:title}.
  4. Select Save.
  5. Select either Activate for all documents or Save and activate.

Step 3. Create the Pretty URL template for all other documents that do not have a version number.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select Add template) in the Pretty URLs for documents section.
  3. Enter the following as the template: {document.ft:prettyURL}/{ft:title}.
  4. Select Save.
  5. Select either Activate for all documents or Save and activate.

After the document template hierarchy, create a Pretty URL template for the topics.

  1. Select Pretty URL in the Knowledge Hub section of the Administration menu.
  2. Select +Add template) in the Pretty URLs for topics section.
  3. Enter the following as the template: {document.ft:prettyURL}/{ft:title}.
  4. Select Save.
  5. Select either Activate for all documents or Save and activate.

Update the template created in Step 1 of Example 4 when updating the documentation to a new version.

  1. Change the metadata requirement to Version = x, where x is the new version number.
  2. Select Save.
  3. Select either Activate for all documents or Save and activate.
  4. Publish the latest version (version x) of the documentation.