Jump to content

Adding facebook code to homepage text editor


Recommended Posts

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

  • 4 weeks later...

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

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

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...