How Can I grab the current page's URL?
I'm working on an email I'm creating a section of the email that'll say "View in Browser" and I want a velocity script to grab the page's URL...how can I do this? Index block or can it be done with just a script?
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 26 May, 2016 08:17 PM
Hi Matthew,
If the page is within a different Site than the email, you can simply link to the page using it's
link
value (i.e.site://path/to/page
). The cross-site link will have the Site's URL appended onto the front of the page's path.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 Maintain Absolute Links so the generated path to the page is not relative.
Please let me know if you have any questions.
Thanks!
2 Posted by matthew.wren on 27 May, 2016 01:11 PM
Hey Ryan,
Thanks for the help! The maintain absolute links will be crucial since it's an email.
I used a very simplified index calling block to solve my issue.
I attached the settings I used for my index block and here's the results:
So this is my snippet of velocity to grab the link:
I think this is the simplest way, at least for my purposes, to alway have the email's link.
Support Staff 3 Posted by Tim on 27 May, 2016 01:26 PM
Hey Matthew,
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.
Have a good one!
Tim closed this discussion on 27 May, 2016 01:26 PM.