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.
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.
parents-and-self
metadata prefix.
Step 3. (Optional) Add metadata requirements.
It is possible 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.
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}
.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select an empty template (or select Add template) in the Pretty URLs for documents section.
- Define the template as follows:
/Manual/{ft:title
. - Select Add metadata requirement.
- Select the
Category
metadata and theManual
value. - Select Save.
- Select either Activate for all documents or Save and activate.
Example 2
An administrator wants to display all PDF files as /PDF/{document title}
.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select an empty template (or select Add template) in the Pretty URLs for documents section.
- Enter the following as the template:
/PDF/{ft:title}
. - Select Add metadata requirement.
- Select the
ft:mimeType
metadata and theapplication/pdf
value. - Select Save.
- Select either Activate for all documents or Save and activate.
Example 3
An administrator wants all topics to include the parent document title.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select an empty template (or select +Add template) in the Pretty URLs for topics section.
- Enter the following as the template:
{document.ft:prettyURL}/{parents-and-self.ft:title}
. - Select Add metadata requirement.
- Select the
Category
metadata and theManual
value. - Select Save.
- 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.
Step 1. Create the Pretty URL template for the latest version of the document.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select an empty template (or select Add template) in the Pretty URLs for documents section.
- Enter the following as the template:
{ft:title}
. - Select Add metadata requirement.
- Select the
Version
metadata and the4
value. - Select Save.
- Select either Activate for all documents or Save and activate.
Step 2. Create the Pretty URL template for all previous versions of the document.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select +Add template in the Pretty URLs for documents section.
- Enter the following as the template :
{version}/{ft:title}
. - Select Save.
- 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.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select Add template) in the Pretty URLs for documents section.
- Enter the following as the template:
{document.ft:prettyURL}/{ft:title}
. - Select Save.
- Select either Activate for all documents or Save and activate.
After the document template hierarchy, create a Pretty URL template for the topics.
- Select Pretty URL in the Knowledge Hub section of the Administration menu.
- Select +Add template) in the Pretty URLs for topics section.
- Enter the following as the template:
{document.ft:prettyURL}/{ft:title}
. - Select Save.
- 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.
- Change the metadata requirement to
Version = x
, wherex
is the new version number. - Select Save.
- Select either Activate for all documents or Save and activate.
- Publish the latest version (version
x
) of the documentation.