开发者

How to add Like Button to Joomla Module through editor

开发者 https://www.devze.com 2023-04-04 16:49 出处:网络
I would like to add the \'like\' button to a module that will be in the left side of the page.When I add the code that Facebook supplies, Joomla will not save the JavaScript.It only saves the div and

I would like to add the 'like' button to a module that will be in the left side of the page. When I add the code that Facebook supplies, Joomla will not save the JavaScript. It only saves the div and code before and after. What am I missing?

<div id="fb-root"></div> 
  <script>
    (function(d){
              te var js, id = 'facebook-jssdk'; 
              if (d.getElementById(id)) 
                {return;} 
              js = d.createElement('script'); 
              js.id = id; 
              js.async = true; 
              js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; 
              d.getElementsByTagName('head')[0].appendChild(js); 
              }
              (document)
    );
  </script> 
  <div class="fb-like-box" data-href="facebook.com/platform"; data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div`>. 

Let me try this again. When I enter the html and then save the module, I loose everything from the <script> to the </script>开发者_JS百科; tag


Global Configuration -> turn off the editor -> save settings.

Create your module, paste the code and save. When you edit that module in the future be sure to turn the editor off again.


Your editor is filtering your script tags. The easiest solution I found was to install a plugin such as Sourcerer to allow insertion of code (PHP, CSS, JavaScript) directly in to any Joomla article.

http://extensions.joomla.org/extensions/edition/custom-code-in-content/5051

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号