Get full URL from Relative in Telligent Community

This is part of a set of "snippet" posts that I'm going to try and write more often, these posts are (hopefully) useful code snippets I keep forgetting about, so blogging here for easy reference later.

If you ever need the full URL when using Telligent Community this can easily be done with the AbsoluteUrl method.

In velocity:

In code:

This method takes a URL and returns the full URL (include hostname etc.) for example:

Input Output
/some-group/b/some-blog https://www.yoursite.com/some-group/b/some-blog
~/some-group/some-page https://www.yoursite.com/some-group/some-page
https://www.yoursite.com/some-group/w/some-wiki https://www.yoursite.com/some-group/w/some-wiki

Ardour Digital can help you get the most out of Telligent Community. Providing development, training, and advice.

To find out more email hello@ardourdigital.co.uk or call +44 (0)177 3254 150.

  • Post