如何通过编辑器向 Joomla 模块添加 Like 按钮
我想将“喜欢”按钮添加到页面左侧的模块中。当我添加 Facebook 提供的代码时,Joomla 将不会保存 JavaScript。它只保存前后的div和代码。我缺少什么?
<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`>.
让我再试一次。当我输入 html 然后保存模块时,我丢失了从 到
标记的所有内容
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>
tag
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
全局配置->关闭编辑器->保存设置。
创建模块,粘贴代码并保存。当您将来编辑该模块时,请务必再次关闭编辑器。
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.
您的编辑器正在过滤您的脚本标签。我发现的最简单的解决方案是安装 Sourcerer 等插件,以允许将代码(PHP、CSS、JavaScript)直接插入到任何 Joomla 文章中。
http://extensions.joomla.org/extensions/edition/custom -内容中的代码/5051
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