bytedisorder Posted November 13, 2012 Share Posted November 13, 2012 I wanted to add facebook discussion to my knowedgebase articles so I wrote this up: {literal} <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> {/literal} <div class="fb-like" data-href="{$systemurl}{if $seofriendlyurls}knowledgebase/{$kbarticle.id|strip_tags}/{$kbarticle.urlfriendlytitle}.html{else}knowledgebase.php?action=displayarticle&id={$kbarticle.id}{/if}" data-send="true" data-width="590" data-show-faces="true" data-action="recommend"></div> <br /><br /> {$kbarticle.id} {literal} <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> {/literal} <fb:comments href="{$systemurl}{if $seofriendlyurls}knowledgebase/{$kbarticle.id}/{$kbarticle.urlfriendlytitle}.html{else}knowledgebase.php?action=displayarticle&id={$kbarticle.id}{/if}" num_posts="5" width="590"></fb:comments> Unfortunately what that gives me is links to the last article on the read more not the urls for the knowledgebase page. Does anybody have a solution for this? 0 Quote Link to comment Share on other sites More sharing options...
bytedisorder Posted November 13, 2012 Author Share Posted November 13, 2012 Got it, this works! {literal} <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> {/literal} <div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="590" data-show-faces="true" data-action="recommend"></div> <br /><br /> {literal} <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> {/literal} <fb:comments href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" num_posts="5" width="590"></fb:comments> 0 Quote Link to comment Share on other sites More sharing options...
cacthanh123 Posted June 8, 2013 Share Posted June 8, 2013 Got it, this works! {literal} <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> {/literal} <div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="590" data-show-faces="true" data-action="recommend"></div> <br /><br /> {literal} <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> {/literal} <fb:comments href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" num_posts="5" width="590"></fb:comments> Error with https server I changed : {$smarty.server.HTTPS_HOST}{$smarty.server.REQUEST_URI} for like, it's working .. I changed : {$smarty.server.HTTPS_HOST}{$smarty.server.REQUEST_URI} for comment, get an error. "The comments plugin requires an href parameter." Please help me fix this problem. Thank's 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.