Generate URL to current page

Is there a portal function that can be used to generate a full URL to the current page?

Hi Helge,

CMS 4.7 or XP 6.0?

With “full URL” you mean also the domain name?

6.0! :smile:

Yes, I mean the domain name as well. Is it possible, or should the domain name be stored as e.g. a site configuration?

There is a type parameter on all “url” functions to control what kind of url to create. Set this to “absolute” to include domain name…

http://xp.readthedocs.org/en/stable/reference/view-functions/pageUrl.html

1 Like

The request also contains everything you need in order to build your own url’s.

NB The view functions automatically handle vhost mappings too :slight_smile:

1 Like

Excellent! Thank you! :slight_smile: