Adding Internal Links - Use Local URLS
The Oregon.gov SharePoint system includes a few different development environments. This includes the authoring environments where you will want to add and edit content. These environments all come with their unique URLs. See this article for more information about those environments.
While adding links to your sites content there is an easy way to avoid any confusion over which URL to use. This is called using a local URL.
Local URLs work with any agency sites that use the URL scheme where the agency (acronym or chosen abbreviation) follows oregon.gov:
https://www.oregon.gov/oha/
or
https://stage.oregon.gov/oha/
You can use local URLs to create links to any page or document hosted on your site.
It also works great for any site that uses www.oregon.gov in its URL. So if you want to link to a document hosted on a different agencies site, use the local URL if possible.
SharePoint will know which environment the visitor is in, and will update the URL accordingly to work within that environment.
So if a visitor is on the Production site of OHA, SharePoint will update the local URL:
/oha/Documents/Public-Health-Division.pdf
to be the Production version:
https://www.oregon.gov/oha/Documents/Public-Health-Division.pdf
Using a local URL ensures that we don't accidentally link to a something in an authoring environment. Doing so will cause SharePoint to prompt the visitor to log in on assumption that they have permissions and wish to begin edits within the authoring environment.
Getting the Local URL
Here is a URL of a document that is hosted on the OHA site:
https://www.oregon.gov/oha/Documents/Public-Health-Division.pdf
To get the local URL, remove everything from 'http' through '.gov'. The local URL of the above link would be:
/oha/Documents/Public-Health-Division.pdf
Local URLS should start with a backslash '/' followed by the agency acronym or chosen abbreviation.
Local URL examples:
/odot/Projects/Pages/archive.aspx
/osfm/about-us/Pages/newsfeed.aspx
Adding Links in the HTML
Say you are wanting to add a link to a Document stored on your site into a page's HTML (or just link to another page on the site). You can do so using the Local URL in an anchor element. This would look like:
<a href="/oha/Documents/Public-Health-Division.pdf">Public Health</a>
Adding Links in a List
While building a list or library, if you wish to have a column include URLS, use local URLS where you can. The same column can include non-local URLs and local URLs and still function properly.
Hyperlink Columns
Hyperlink columns are one of the few column options that come with two data properties in the same column. You can add a Address URL for the link as well as the Display Text you would like the visitor to see. If you click the little link icon next to the cell, you can add both properties separately:
Use a Local URL here were possible.
However, these dual properties can cause SharePoint to insert the full (non-local) URL even if it isn't what was originally added in that location.
If this happens the easiest way to make it a local URL is to double click into the cell, and delete the beginning of the URL:
Once you choose to 'Stop editing this list' that entry will be updated with a local URL.
Comments
0 comments
Please sign in to leave a comment.