• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How to replace Tweet with Follow button in sidebar_share_page

#1
How do I replace the Tweet button with Follow in the sidebar?

I can't be the only one who thinks that Follow makes more sense than Tweet in the sidebar. There are few scenarios under which a visitor would start randomly tweeting about a forum, whereas following is a more natural action if someone likes the site.
 

Brogan

XenForo moderator
Staff member
#2
You would have to edit the template and add the follow code for your Twitter account.

See the guides here for how to determine and edit the template: How To...
 
#4
I never managed to do this properly. This is the current code in that template:

Code:
<xen:if is="{$xenOptions.tweet.enabled}">
                    <div class="tweet shareControl">
                        <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"
                            data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
                            data-url="{$url}"
                            {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
                            {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
                    </div>
</xen:if>
And these are Twitter's instructions:
How to add a Follow button to your website
1. Create a new anchor element with a twitter-follow-button class to allow Twitter’s widgets JavaScript to discover the element and enhance the link into a Follow button. Set a href attribute value of a Twitter profile URL.
Code:
<a class="twitter-follow-button"
href="https://twitter.com/TwitterDev">
Follow @TwitterDev</a>
2. Customize Follow button parameters using data-* attributes.
Code:
<a class="twitter-follow-button"
href="https://twitter.com/TwitterDev"
data-size="large">
Follow @TwitterDev</a>
3. Asynchronously load Twitter’s widgets JavaScript using our loading snippet. The JavaScript snippet will check for an existing version of Twitter’s widgets JavaScript on the current page, initialize a function queue to be executed once the widgets JavaScript has loaded, and load the widgets JavaScript asynchronously from Twitter’s CDN.
Since XenForo already includes Twitter's javascript, I skipped that part, but the button does not render. Do I need to include Twitter's JavaScript again?