We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to add a link which will open on the current parent domains URL?

In case you would like to have a link in your template that opens on the current parent domain's URL, you can use the following code snippet:

onclick="window.open(document.referrer+'account','_parent')"

For example, it can be used like this for a link to the My Account section for logged in users:

HTML
<div class="login-text" ng-if="isUserValid()">You are logged in. <a class="login unbutton" target="_parent" onclick="window.open(document.referrer+'website/my-account-section','_parent')">View your account here.</a>

This is especially useful in case you are going to be showing the same template on multiple websites. Using the above, you won't need to hard code the URL of the website into the template's code but can make use of this general one.

Last updated: