tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/14255-how-can-i-grab-the-current-pages-urlCascade CMS: Discussion 2016-05-27T13:26:41Ztag:help-archives.hannonhill.com,2010-02-09:Comment/399772712016-05-26T20:17:22Z2016-05-26T20:17:22ZHow Can I grab the current page's URL?<div><p>Hi Matthew,</p>
<p>If the page is within a different Site than the email, you can
simply link to the page using it's <code>link</code> value (i.e.
<code>site://path/to/page</code>). The cross-site link will have
the Site's URL appended onto the front of the page's path.</p>
<p>If the page is within the same Site, there is currently no way
to create a fully qualified link to the page without manually
appending the domain information onto the front of the page's path.
You will also need to configure the "email page" to
<strong>Maintain Absolute Links</strong> so the generated path to
the page is not relative.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/399772712016-05-27T13:11:58Z2016-05-27T13:11:58ZHow Can I grab the current page's URL?<div><p>Hey Ryan,</p>
<p>Thanks for the help! The maintain absolute links will be crucial
since it's an email.</p>
<p>I used a very simplified index calling block to solve my
issue.</p>
<p>I attached the settings I used for my index block and here's the
results:</p>
<pre>
<code><?xml version="1.0" encoding="UTF-8"?>
<system-index-block name="current page" type="folder" current-time="1464354465130">
<calling-page>
<system-page id="e475086f86c604b2730f35c70a99447b" current="true">
<name>version3</name>
<path>/emails/2016/06/version3</path>
<site>Undergraduate Admissions</site>
<link>site://Undergraduate Admissions/emails/2016/06/version3</link>
</system-page>
</calling-page>
</system-index-block></code>
</pre>
<p>So this is my snippet of velocity to grab the link:</p>
<pre>
<code><a href="${_XPathTool.selectSingleNode( $contentRoot, '/system-index-block/calling-page/system-page/link').value}">View Email in Browser</a></code>
</pre>
<p>I think this is the simplest way, at least for my purposes, to
alway have the email's link.</p></div>matthew.wrentag:help-archives.hannonhill.com,2010-02-09:Comment/399772712016-05-27T13:26:39Z2016-05-27T13:26:39ZHow Can I grab the current page's URL?<div><p>Hey Matthew,</p>
<p>Glad to hear that Ryan was able to help out. I appreciate you
sharing what worked for you so that others on this forum can get
ideas if they ever need to accomplish something similar to
this.</p>
<p>Have a good one!</p></div>Tim