Kentico CMS 7.0 Developer's Guide

Linking pages and files

Linking pages and files

Previous topic Next topic Mail us feedback on this topic!  

Linking pages and files

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Creating permanent links to documents (pages)

 

If you need to create a permanent link to a document, use a URL in the following format:

 

<domain>/getdoc/<document GUID>/<document name><extension>

 

<document GUID> is the globally unique identifier of the document. You can find a document's GUID value in CMS Desk -> Content -> Properties -> General -> Node GUID.

The <document name> value may contain any text — it is not used by the system, but allows you to specify the exact URL (e.g. for the purposes of search engine optimization). By default, the system uses the document's name.

 

Permanent links keep working even if you move the target document to another location.

 

For example:

 

http://www.example.com/getdoc/016fad52-0d69-46d5-80dc-daec9173c0c7/Products.aspx

 

is the permanent equivalent of:

 

http://www.example.com/company/products.aspx

 

Linking specific language versions of documents

 

If you need to link to a specific language version of a document, you use a URL in the following format:

 

<domain>/getdoc/<document GUID>/<document name>/<culture code><extension>

 

For example:

 

http://www.example.com/getdoc/8FG7-84E394-FABD-5678/our-services/fr-fr.aspx

 

Displays the given document in French (if the document is translated). It is an equivalent of:

 

http://www.example.com/company/our-services.aspx?lang=fr-fr

 

Linking attachments

 

If you need to create a permanent link to a file uploaded as a document attachment, you use a URL in the following format:

 

<domain>/getattachment/<file GUID>/<filename><extension>

 

The <file GUID> is not the same as the document GUID. It is the GUID of the file in the CMS_Attachment database table. To find the GUID of an attachment, click the attachment in CMS Desk -> Content -> Properties -> Attachments and view the URL.

The <file name> value can contain any text.

 

For example:

 

http://www.example.com/getattachment/763c8921-be94-4610-99b4-25e8d3be5b08/logo.aspx

 

You can find information about the query string parameters available for file URLs in GetFile.aspx parameters.