Page 1 of 1

twitter button on Revigniter page

Posted: Thu Aug 08, 2013 12:32 am
by Martin Koob
I have been trying without success to add a twitter button to a webpage on a site built with revigniter.

I went to this page to build the button. https://twitter.com/about/resources/buttons#tweet
It generated the following code.

Code: Select all

<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.example.com" data-text="Check out www.example.com" data-via="example" data-size="large" data-hashtags="example">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
I pasted this into a view file but only the hyperlinked text tweet would display (not the button rendering with the logo) and if you click on the link the tweet would only show
the url of the controller page (where the controller is named 'followus'
ie.

http://example.com/index.lc/followus

Is the problem that the script tags are within the body of the page if I paste into the view page?

Any suggestion would be welcome.

Thanks