How to add text after URL, in default text?


#1

Is it possible to add text after shared URL?

For example, I want to share this:

“Share this URL: http://www.myURL.com! Thanks! #Example

so in tag for link I have:

href=“https://twitter.com/share” class=“twitter-share-button” data-lang=“en” data-text="Share this URL: " data-hashtags=“Example” data-url=“http://www.myURL.com

and this is giving me the output:

“Share this URL: http://www.myURL.com #Example

Is it possible to add additional text, after the URL is written?

Thanks.


#2

The url parameter will always be appended after the text. If you wanted to share a custom string, you could just set data-text=Share this URL: http://www.myURL.com Thanks! rather than the separate parameter.

B


#3

But in that case I have this format of text that is shared:

Share this URL: http://www.myURL.com Thanks! http://www.myURL.com

the current URL is also appended at the end, even if it’s not set up as data-url. In my text I want the URL to appear only one time.


#4

Ah, I see. Yes, the share button will always take the current URL is none is provided. There’s not a way to disable the url parameter in this case.

An alternative would be to use the Hashtag button variation:

Or, you could use your own link to the Intent directly, configuring the URL parameters as you please.

Keep in mind that the text you’re setting up is going to require the user to edit it before they can share, I’m not sure how much you’re going to gain with the tweaks. The text part will be auto-selected in the browser, with the URL and Hashtag not, so that the user will type over the placeholder text but not the URL itself. With your alternate formatting you increase the amount of effort someone has to take to actually share the link, which we know from experience will result in less shares.

Ben


#5

I want the tweets to be as more user-friendly as possible. So because of that I changed the format of the tweets. I won’t append text after the URL is shown.

Thanks. :slight_smile:


#6

#7