Jump to content

[SOLVED] Twitter script conflict?


Recommended Posts

Using the script I got from Twitter. Try putting it in a cms and a freestyle block and on the front page content and in the footer content.

 

<a href="https://twitter.com/OleanQuilters" class="twitter-follow-button" data-show-count="false">Follow @OleanQuilters</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);[spam-filter](document,"script","twitter-wjs");</script>

Link to comment
Share on other sites

Why don't you try that link? There is a free one.

 

http://www.prestasho...er-button-free/

 

Or this one. A flying bird:

 

http://www.prestasho...le-fly-twitter/

 

Alternatively, you can check this thread, too

 

http://www.prestashop.com/forums/topic/38481-twitter-block-module/

 

Hope this helps!!!

Edited by Caglar (see edit history)
Link to comment
Share on other sites

  • 11 months later...

Using the script I got from Twitter. Try putting it in a cms and a freestyle block and on the front page content and in the footer content.

 

<a href="https://twitter.com/OleanQuilters" class="twitter-follow-button" data-show-count="false">Follow @OleanQuilters</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);[spam-filter](document,"script","twitter-wjs");</script>

 

For the ones who doesn't want a module, you can just add {literal} {/literal} before and after script.

You can then add the code in any .tpl

So it gives you :

 

<a href="https://twitter.com/OleanQuilters" class="twitter-follow-button" data-show-count="false">Follow @OleanQuilters</a>

{literal}

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);[spam-filter](document,"script","twitter-wjs");</script>

{/literal}

 

You can see it live here using the twitter feed.

 

Every little helps...

  • Like 1
Link to comment
Share on other sites

thanks for your know how.

Method provided by you is good for merchants with basic knowledge about coding,

if someone don't know how to use FTP etc. it's better to use available modules

 

that's my opinion, but of course your method is absolutely right

Link to comment
Share on other sites

I totally agree with you. Some "basic " knowledge are necessary but I found it so much easier than modules for couples of reasons :

 

-You can place you code wherever you want. You don't need to look for those Hooks( by the way, the hooks are the "most horrible thing" in Prestahop, I don't need to talk about their "Live edit module position", it's only good the basic theme)

 

-If new update from external link and script comes ( like Facebook new plugins or a change of website link), it's easier to access to the code and change it.

 

-You can really adapt it to your theme and website layout

 

So at the end it's really worth it to learn a little bit about coding in prestashop.

But you are right, do not try this change if you don't have a clue about what your are doing :)

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Solution given by 98dianast works like a charm, sometimes is better to put the code wherever you want than a module.

 

The thing is, the script of the G+ button doesnt need the {literal} to work, anyone know why the twitter script does ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...