Keyword

[SOLVED] K2 facebook comments

  • Chrysanthos
  • Chrysanthos's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago - 11 years 1 month ago #117113 by Chrysanthos
[SOLVED] K2 facebook comments was created by Chrysanthos
hi,
what facebook comment extension do you use here? getk2.org/about
Thanks in advance

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago - 11 years 1 month ago #117114 by VietPublic
Replied by VietPublic on topic Re: K2 facebook comments
Overide your template ex
Copy ROOT\components\com_k2 to
ROOT\templates\YOUR_TEMPLATE\html\ (create html folder if not exist)
Edit
ROOT\templates\YOUR_TEMPLATE\html\com_k2\templates\default\item.php
After line 673 (before K2_BACK_TO_TOP code) add code
  <!-- Facebook Comments -->
<?php if($this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)): ?> 

        <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_US/all.js#xfbml=1"; 
                fjs.parentNode.insertBefore(js, fjs); 
                }(document, 'script', 'facebook-jssdk'));
        </script> 

        <div class="fb-comments" data-href="<?php $url="".$this->item->absoluteURL; echo $url; ?>" data-width="500" data-num-posts="10"></div> 

<?php endif; ?>

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #117115 by Mariak Bol
Replied by Mariak Bol on topic Re: K2 facebook comments
Hi, I have tried to follow the procedures to override but still doesn't give me Facebook comments in my Joomla 3 K2 articles. Please explain little more, Thanks

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #117116 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 facebook comments
Have you read the documentation in Facebook developers? Have you created a Facebook App?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #117117 by Mariak Bol
Replied by Mariak Bol on topic Re: K2 facebook comments
Yes i have created Facebook App. Where shoud I paste or add the App ID in the code?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #117118 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 facebook comments
Yes, Also check with the developers.facebook.com site if the code has changed in anyway

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #117119 by Corneliu Ciornei
Replied by Corneliu Ciornei on topic Re: K2 facebook comments
hi,
i have 2 questions...

1.where i have to add api code
2.when i'm inserting the code for facebook comments, will appear both block for comments

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #117120 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 facebook comments
In your item.php (you should override it, if your template doesn't have one)

This tutorial will explain overriding: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #117121 by tai
Replied by tai on topic Re: K2 facebook comments

VietPublic wrote: Overide your template ex
Copy ROOT\components\com_k2 to
ROOT\templates\YOUR_TEMPLATE\html\ (create html folder if not exist)
Edit
ROOT\templates\YOUR_TEMPLATE\html\com_k2\templates\default\item.php
After line 673 (before K2_BACK_TO_TOP code) add code

  <!-- Facebook Comments -->
<?php if($this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)): ?> 

        <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_US/all.js#xfbml=1"; 
                fjs.parentNode.insertBefore(js, fjs); 
                }(document, 'script', 'facebook-jssdk'));
        </script> 

        <div class="fb-comments" data-href="<?php $url="".$this->item->absoluteURL; echo $url; ?>" data-width="500" data-num-posts="10"></div> 

<?php endif; ?>


Awesome, it worked, I love you so much !!!!!

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #117122 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
hi all .
What changes to this code i have to make so only the facebook comment box shows.
I followed the steps in this topic and both boxes k2 & facebook appears . If i disable the k2 comment it's disappear both of them . Can anyone help me please. :(

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum