Friday, October 15, 2010

Developer Quick Tip: An URL that’s easier to share

Today, I thought I’d share a little known trick to shorten and simplify the URLs you share with others. I’m sure you’re all familiar with the vast majority of URLs to your site that look something like this:

https://www.clickcommerce.com/cc/Rooms/DisplayPages/LayoutInitial?Container=com.webridge.entity.Entity%5BOID%5B74531D0B99B5E14E848802448409917B%5D%5D

LayoutInitial is a primary driver of most content pages, including personal pages, and project workspaces. The way it knows which project workspace, personal page, or content page to display is by looking at the value passed via the Container query string parameter. While the computer has no problem reading this value, it’s not so easy for us humans to share this with each other. But, wait! There’s a better way…

That same URL has an alternate format that is recognized by Click Commerce Extranet and has a format that is easier to utter and share with others. It looks like this:

https://www.clickcommerce.com/cc?PageID=TOMBLOG

Now that’s not so much of a mouthful, is it? The query string parameter “PageID” is recognized by Extranet and allows you to send in the ID of the page to which you want to direct the user. All pages have an ID and it’s pretty easy to find. As a user with the rights to edit a page can easily find the ID of that page by clicking the “Properties” button in the upper right corner (just under the page header). Extranet will automatically assign a Page ID, but you also have the ability to assign a Page ID that better describes the page to make it even more memorable.

This URL format causes the Framework to perform 1 additional lookup in order to get it’s hands on the actual page and so is  slightly less efficient than the longer URL. This is why it’s not used by default when the system is rendering URLs to pages in the site. It is, however, incredibly convenient to use this format when sharing an URL with other humans.

Cheers!

2 comments:

  1. Is there a easier way to make a url to a document?

    ReplyDelete
  2. Most definitely. The feature that supports this is called "Custom Corpus Virtual Root" and it allows for a short form of the document URL that will always link to the latest version of the document. You can read more about this feature in the Click Knowledgebase on ClickCommerce.com. Specific details can be found in the Server Administration Guide.

    ReplyDelete