steviger Posted December 13, 2012 Share Posted December 13, 2012 Hi, I would like to add a Facebook Activity feed box to the content of my homepage text. What I did is stuff as suggested in this post I added the code: <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> to my header.tpl, right above the <div id="page"> tag. Next added the code: <div id="facebook"><div class="fb-activity" data-site="http://www.domain.com" data-app-id="0000000" data-width="200" data-height="241" data-header="true" data-border-color="#ffffff" data-recommendations="true"></div></div> to the HTML source in the homepage text editor. When I look in the generated source I see the FB SDK code allright but where the box should appear, I only see <div id="facebook"></div> Help is much appreciated. Cheers, Steven Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted December 13, 2012 Share Posted December 13, 2012 Did you remember to wrap your script with {literal}{/literal}? {literal} <script> /*FB CODE GOES HERE*/ </script> {/literal} Marty Shue Link to comment Share on other sites More sharing options...
steviger Posted December 13, 2012 Author Share Posted December 13, 2012 Yes I did (forgot to mention that, sorry...). With both pieces of code. Link to comment Share on other sites More sharing options...
steviger Posted January 7, 2013 Author Share Posted January 7, 2013 Hi, I've put the header code between the literal tags. And this code in my frontpage editor: <div class="fb-activity" data-site="http://www.domainname.com" data-width="200" data-height="241" data-header="true" data-border-color="#ffffff" data-recommendations="true"></div> The thing is that, when I paste the code in the source of the editor and after updating I look in the source again, the code is gone. Any ideas on how to solve this? Cheers, Steven Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted January 7, 2013 Share Posted January 7, 2013 Unfortunately, what you are trying to do will not work using the WYSIWYG editor. It will remove the JS upon save. We have a module that will allow to do this quickly and easily. You can read more about it here http://prestashop.carolinacustomdesigns.com/front-office-features/2-multi-block-arbitrary-text-or-html.html If you do not wish to use a module you will need to manually add the code. Marty Shue Link to comment Share on other sites More sharing options...
steviger Posted January 8, 2013 Author Share Posted January 8, 2013 Hi Marty, Thanks for your reply. I know that the editor doesn't take JS. However, I thought the script is in the header.tpl and in the editor just the <div> tags.. Cheers, steven Link to comment Share on other sites More sharing options...
vekia Posted January 8, 2013 Share Posted January 8, 2013 you can also use our free solution called html block which is available here: http://www.prestashop.com/forums/topic/189039-module-html-box-for-free/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now