Jump to content
steviger

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More