Creating a tweet this link, HTML encoding
What I'd like to do is have a user be able to enter these two items into Data Definition fields:
Tweet text:
MSU geologist Masako Tominaga & her students map the ocean
floor to study the earth’s polarity.
Trackable URL:
go.msu.edu/FLF5
Then be able to generate a "tweet this" link in Velocity that would result in a final URL like:
http://twitter.com/intent/tweet?text=MSU+geologist+Masako+Tominaga+%26+her+students+map+the+ocean+floor+to+study+the+earth%E2%80%99s+polarity.+go.msu.edu%2FLF5+%23SpartansWill
Any help would be appreciated, I figured that it might have been something that someone already has done.
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 20 Mar, 2015 06:44 PM
Hi,
Once you set up the Data Definition fields, you can use the Velocity Escape Tool to encode the string and URL.
Consider the following snippet to get you started:
Note: this code will also account for cases where the entire tweet text is greater than 140 characters and will truncate the text before adding on the url.
Please let me know if you have any questions.
Thanks!
Ryan Griffith closed this discussion on 08 Apr, 2015 02:33 PM.