Friendly URLs - Akumina Community

Friendly URLs

Estimated reading time: 4 min

A number of the Akumina Widgets as well as the Akumina Foundation Site take advantage of the “Friendly URL” functionality which makes it possible to leverage a single “page” to display different content items from a list.  Two examples in the Foundation Site include the “News Detail” and the “Event Detail” widgets.  The purpose of this topic is to describe how to setup the Friendly URL support in SharePoint.

Character restrictions for Friendly URLs

For the friendly URL, there are character restrictions due to the way URLs work. Specifically, there are characters that are not allowed in the title to enable the proper function of the URLs:

 

Acceptable:

A-Z, a-z, 0-9, -, _, + , %

 

Not acceptable:

., ~, :, /, ?, #, [, ], @, &,=

 

Creating a Friendly URL on the Site Collection Parent

Setting Navigation Options for the Parent Site Collection

We will be using the setup of the “Company News” content as an example for this section.

The Site Collection parent site will use the “Site Navigation” term that was created when the site collection was generated.

Navigate to Site Settings > Navigation and set

  • Global Navigation = “Managed Navigation….”
  • Current Navigation = “Managed Navigation…”
  • Manage Navigation:  Term Set = “Site Navigation”.
  • Managed Navigation: Default Page Settings – UNCHECK “Add new pages to navigation automatically”.
  • Click OK.

Create the Term Set for the Friendly URL

A “Term Set” is required to create an Alias/Term for Navigation, i.e. “Site Navigation”

Navigate to Site Settings > Term store management (found under heading “Site Administration”).

  • Click on the arrow next to “Site Collection – …” (found in the Taxonomy Term Store Column)
  • The folder should expand
  • Right Click on “Site Navigation” from the dropdown and click on “Create Term”. Enter a unique term name, which in our example is “CompanyNews”.

The new term “CompanyNews” will be highlighted in the left column, in the right pane click on the Tab “TERM-DRIVEN PAGES”.

  • Under the section titled “Target Page Settings”, check the box for “Change target page for this term”.
  • Click on the “Browse…”, button (to the right of the check box “Change target page for this term”) navigate.
  • A modal window will appear where you can scroll on the left pane to expand the SITE (if on subsite e.g. Human Resource) find the SharePoint page Library “Page” for the appropriate site.
  • Click on the Pages directory.
  • In the Right pane double click on your target page, which in this example is “NewsDetail.aspx”.
  • Under the section titled “Catalog Item Page settings” check the box for “Change Catalog Item Page for this category”.
  • Click on the “Browse…”, button (to the right of the check box “Change Catalog Item Page for this category”) navigate.
  • A modal window will appear where you can scroll on the left pane to expand the SITE (if on subsite e.g. Human Resource) find the SharePoint page Library “Page” for the appropriate site.
  • Click on Pages.
  • In the Right pane double click on “NewsDetail.aspx”.
  • The Configure Friendly URL for this term page should look similar to below, click on Save.
  • To complete the setup process for the Parent Site collection, go to Creating/Updating the FriendlyURL Column in the Target List

 

Creating a Friendly URL on a Subsite

Create the Term Set for the Friendly URL

Unlike for the Parent of the Site Collection, on a subsite the Term Set doesn’t exist so must be created first before setting the navigation options.

  • Navigate to the Department/Subsite.
  • Navigate to Site Settings > Term store management.
  • Under the “TAXONOMY TERM STORE” column, right click on “Site Collection – …” and create a new “Term Set”, with a name specific to the Department/Subsite, example:  HRNavigation.

Setting the Navigation Options for the Subsite

Unlike the Parent of the Site Collection, on a subsite the Term Set must be created first before setting the navigation options.

Navigate to Site Settings > Navigation. And set the following values:

  • Global Navigation = “Managed Navigation….”
  • Current Navigation = “Display the same navigation items as the parent site
  • Manage Navigation:  Term Set = “HRNavigation”.
  • Managed Navigation: Default Page Settings – UNCHECK “Add new pages to navigation automatically”.
  • Click OK.

Create the Term Set for the Friendly URL

Navigate to Site Settings > Term store management (found under heading “Site Administration”).

  • Click on the arrow next to “Site Collection – …” (found in the Taxonomy Term Store Column)
  • The folder should expand
  • Right Click on the new Term Set you just created (“HRNavigation” in our example) and select “Create Term” from the dropdown
  • Enter the unique term name (example: “HRNews”).

“HRNews” will be highlighted in your left column, in the right pane click on Tab “TERM-DRIVEN PAGES”.

  • Under the section titled “Target Page Settings”, check the box for “Change target page for this term”.
  • Click on the “Browse…”, button (to the right of the check box “Change target page for this term”) navigate.
  • A modal window will appear where you can scroll on the left pane to expand the SITE (if on subsite e.g. Human Resource) find the SharePoint page Library “Page” for the appropriate site.
  • Click on Pages.
  • In the Right pane double click on the target page (“NewsDetail.aspx” in our example).
  • Under the section titled “Catalog Item Page settings” check the box for “Change Catalog Item Page for this category”.
  • Click on the “Browse…”, button (to the right of the check box “Change Catalog Item Page for this category”)
  • A modal window will appear where you can scroll on the left pane to expand the SITE (if on subsite e.g. Human Resource) find the SharePoint page Library “Page” for the appropriate site.
  • Click on Pages.
  • In the Right pane double click on the target page (“NewsDetail.aspx” in our example).
  • The Configure Friendly URL for this term page should look similar to below, click on Save.
  • To complete the setup process, go to Creating/Updating the FriendlyURL Column in the Target List

 

Creating/Updating the FriendlyURL Column in the Target List

In the target list(s) that contain the content to be displayed (in our example CompanyNews_AK and DeptNews_AK), a list column called “FriendlyURL” should be created (if it does not already exist) with the following attributes:

  • Column Name: FriendlyURL
  • Type: Calculated
  • Data type returned: Single line of text

In the formula section, for non-multilingual sites, the following calculation should be entered:

  • =”RelativeSitePath/NavigationTerm/”&Title
  • Examples:
    • =”/sites/Akqa1034Training1/CompanyNews/”&Title
    • =”/sites/Akqa1034Training1/HR/HRNews/”&Title

In the formula section, for multilingual sites, the following calculation should be entered which also ensures that the correct language version of an item is displayed:

  • =”RelativeSitePath/NavigationTerm/”&AkLanguageCode&”/”&Title
  • Examples:
    • =”/sites/Akqa1034Training1/CompanyNews/”&AkLanguageCode&”/”&Title
    • =”/sites/Akqa1034Training1/HR/HRNews/”&AkLanguageCode&”/”&Title
If you need help determining what the RelativeSitePath is, login to SharePoint 2013 Central Administration > Application Management > View all Site Collections. Select the appropriate “Web Application” on far right.  The site collections will appear on the left under URL – * can be found there.
Was this article helpful?
Dislike 0
Views: 35
//]]>