Permalinks

Permalinks provide clients with memorable page addresses that can be easily marketed to their visitors. 

For example, https://production.perpetuatech.com/index.cfm/PageID/1782/index.html can be replaced with https://production.perpetuatech.com/permalinks.

This allows for more targeted marketing and gives visitors better options in navigating around the website.

Turn On Permalinks in the Perpetua Console

In the Perpetua Console, pull up the website's settings.

Under the section "Features in Development," check the box "Use Page Permalinks."

When done, click Save.

Update Layout Files

In the PriNav script, find the following:

<cfif fldExternalLink is "" OR request.page_adminAccess>
    <cfset link2display = "#variables.baseHref##request.self#/PageID/#fldPageID_PK##request.addtoken#">
<cfelse>
    <cfset link2display = fldExternalLink>
</cfif>

This should be replaced with the following:

<cfif len(fldExternalLink) and not val(request.page_adminAccess)>
    <cfset link2display = fldExternalLink>
<cfelseif val(qry_sitesecurity.fld_site_permalinks) and len(fldAlias)>
    <cfset link2display = fldAlias>
<cfelse>
    <cfset link2display = "#variables.baseHref##request.self#/PageID/#fldPageID_PK##request.addtoken#">
</cfif>


If there is any kind of subnavigation in the design, find the following script:

<cfquery name="qry_toolbarsub2" datasource="#request.dsn#" username="#request.dsn_username#" password="#request.dsn_password#">
    SELECT fldPageID_PK, fldTitle, fldExternalLink, fldToolBarTitle, fldParentID
    FROM tblPages
    WHERE fldSiteID = '#REQUEST.SiteID#' AND fldParentID = #fldPageID_PK#
    ORDER BY fldSortID
</cfquery>

Add what's in bold:

<cfquery name="qry_toolbarsub2" datasource="#request.dsn#" username="#request.dsn_username#" password="#request.dsn_password#">
    SELECT fldPageID_PK, fldTitle, fldExternalLink, fldToolBarTitle, fldParentID, fldAlias
    FROM tblPages
    WHERE fldSiteID = '#REQUEST.SiteID#' AND fldParentID = #fldPageID_PK#
    ORDER BY fldSortID
</cfquery>

Remember that expandadivs also generate parent and child pages. These changes should also be reflected in the expandadiv in websites that call for it.

Auto-Generate Permalinks

Once permalinks have been activated in the Perpetua Console and the scripts have been updated in all appropriate layout files, new permalinks must be generated. 

In your browser, go to: [http://www.domain.com]/index.cfm/fuseaction/top.page_permalinks/index.html

This will create permalinks for all pages that did not previously have one.

Test All Layout Files

The conversion should now be completed.  In your browser, spend some time navigating through the website.  You should not see any Page ID numbers in the address bar. 

Check for ColdFusion errors, Page IDs, and any area where the updated scripts were not applied.  When done, submit the project.