Jump to content

Adding Facebook Share button in Knowledgebase articles


mwaraitch

Recommended Posts

I would have thought the easiest way, for a one-off article, would be to use the Facebook Share tool - https://developers.facebook.com/docs/plugins/share-button

 

mjPomJh.png

 

that would generate the code that you can add to the WHMCS site - e.g if using the SDK solution into header.tpl and then the button code into the article itself, or if using iframe, just into the article.

 

alternatively, if you don't want to edit the articles and want the share button added to every kb article automatically, you could edit the knowledgebasearticle.tpl template and change...

 

<blockquote>
   {$kbarticle.text}
</blockquote>

to...

 

<blockquote>
   {$kbarticle.text}<br /><iframe src="https://www.facebook.com/plugins/share_button.php?href={$systemurl}{$filename}.php?action=displayarticle&id={$kbarticle.id}&layout=button&size=small&mobile_iframe=true&width=60&height=20&appId" width="60" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</blockquote>

obviously, you can put the button anywhere on the page that you feel is most suitable. :idea:

 

EiVQgIF.png

 

... or with a bit of work, you can turn it into a sidebar and have similar sharing links for Google+ and Twitter... with the option of including it on any WHMCS page you choose. :idea:

 

VduyAhr.png

Link to comment
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated