close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding to a twitter link

Thread began 8/22/2011 8:59 am by alistair316863 | Last modified 8/24/2011 4:19 pm by Jason Byrnes | 1333 views | 8 replies |

alistair316863

Adding to a twitter link

At the moment when you click on the twitter link it just shares the url of the page. I would like to add my twitter account to the end of the url. For example

www.mycompany.com @mycompany

How would i go about doing this please?

Sign in to reply to this post

Jason ByrnesWebAssist

the code added to the page for the twitter share button will look like:

<div id="custom-tweet-button"> <a href="http://twitter.com/share?url=<?php echo urlencode('http://www.mycompany.com'); ?>" target="_blank" title="Tweet"></a> </div>




you can edit that code to add your twitter account to the end:

<div id="custom-tweet-button"> <a href="http://twitter.com/share?url=<?php echo urlencode('http://www.mycompany.com/@mycompany'); ?>" target="_blank" title="Tweet"></a> </div>
Sign in to reply to this post

alistair316863

Thanks for the quick response but this doesnt give me the solution i was after. When adding @companyname to the end it adds it to the url and doesnt have a space between the @ tag and the url.

Ideally id like the tweet to be:

latest news *url* @companyname

but whenever spaces are added to the php echo the tweet it blank.

Sign in to reply to this post

Jason ByrnesWebAssist

perhaps try:
<div id="custom-tweet-button"> <a href="http://twitter.com/share?url=<?php echo urlencode('http://www.mycompany.com/%20@mycompany'); ?>" target="_blank" title="Tweet"></a> </div>

Sign in to reply to this post

alistair316863

Doesnt work sorry; it adds the %20 to the tweet :(

Sign in to reply to this post

Jason ByrnesWebAssist

perhaps if you give your reasoning for wanting to add "@mycompany" to the tweet URL i could come up with something that works

so far you have only told me what you want to do, what is you want to accomplish by doing this? what is your desired end result.

Sign in to reply to this post

alistair316863

Sorry for not being clear, ill try to explain.

On twitter id like "@companyname" to be added to the end so people can see who the message is originally from, view our twitter profile and then ultimately follow the company.

The social media toolkit is on every news story in our news section so it allows people to share a story that they find interesting.

Therefore just for the Twitter share button id like it, once clicked, to be:

"Title of the news story here {url to the news story} @companyname"

I hope this helps.

Sign in to reply to this post

alistair316863

Heres an example of what im after:

At the bottom of the story (before the comments) are the share buttons. Not the ones to the left of the page!

If you click on the Twitter one it displays what i would like from my news stories.

will-libya-help-obama-in-2012

which is: Will Libya help Obama in 2012? - The Week: pBQPJk via @AddThis

Sign in to reply to this post

Jason ByrnesWebAssist

I see, you want to add a user to associate the tweet to.

this is done using via attribute:
tweet-button

<a href="http://twitter.com/share?url=<?php echo urlencode('http://www.mycompany.com/'); ?>&via=mycompany" target="_blank" title="Tweet">
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...