While browsing the WHMCS Forums, I found this post. It seemed like quite a simple tasks, and the overall issue was the same problem I had bumped into when I was writing another mod for the system. The issue with WHMCS is that some variables are only available on specific pages; since all of the WHMCS files are encoded, you can only modify the pages using the integrated tempate system which uses the Smarty Template Engine.

So anyway, the task was to show the top few knowledgebase articles on any template page in WHMCS. Rather than explaining how to install it here, I have just written a little readme.txt file and put that in with the other files. Installation should take you no more than 5 minutes. You can download it here (zip).

Please don’t host this anywhere else. If you would like to link to it, please just link to this post.

Update: Following a readers request, here is a modified version which allows you to get you knowledge base articles on any page (even if it’s not in the WHMCS directory). You can download this version here.

Hi AJIT, I doubt that it will work with a Kayako integrated KB. The mod takes the KB articles directly from the WHMCS DB. It probably wouldn’t be too hard to get it working with Kayako though. Unfortunately I don’t have the Kayako Support Suite to play with, so I cannot really develop it.

I have tried to no avail, but don’t know how to make it show only the articles in the associated category. Say, my category is ‘FTP’, how would I get only those related articles to show, and not The Top Knowledgebase Articles’???

I don’t know anything about SQL Queries, but I have tried to write it to SELECT the column_name (say parentid or whatever) from the tblknowledgebase table_name, but it doesn’t work.

When you click on the actual category name, (FTP) from the KB list of categories page, you’re taken to a page where you can see all the related articles. I just want it so the user can view a list of them in the sidebar area, vs. clicking back and forth.

That didn’t really work. It shows a specific list of articles from one category in any category. So if I’m in the FTP category, with how I have the CATEGORYID set, it shows the FTP articles. And when I switch to the email category, it still only shows the list of FTP articles. I’d like the articles to display under the correct category, when you click on that category; perhaps there’s no way.

Also, I don’t enough about databases and columns and tables, but here’s what I did, and don’t really understand why it doesn’t work.

In phpMyAdmin, I created a new text column in tblknowledgebase and in tblknowledgebasecats and named them both ‘sort’.

In tblknowledgebase, in the field for column sort, I labeled the FTP Articles ‘one’ and the Email Articles ‘two’.

In tblknowledgebasecats, in the field for column sort, I labeled the FTP category ‘one’. And labeled the Email category ‘two’.

These are ‘unique’ columns in both tables. I first created the columns as numeric, but numbers 1 and 2 did not make them unique because of their keys; for whatever reason they are unique as text, but it still does not sort them using the code below. Instead every article shows up in every category. Instead of only FTP articles in FTP category and Email Articles in the Email category. You would think it would work (logically, the code looks and reads right), but it doesn’t??

I thought by omitting the use of tblknowledgebaselinks and using tblknowledgebasecats instead, I would have more control over which articles and category to choose and match them.

I’m thinking I should just use a different helpdesk altogether vs. the built in one offered by WHMCS, because I cannot seem to create an article menu for the individual category pages, and have them display correctly.

Hi, thanks! That does work, but not completely. The right articles do show up, but not on the actual article page. When I click on the Category, for instance, from the knowledge base list, all of the articles show up on the following page, but then disappear when I click on an article topic and am taken to the page to read the article. That’s really where I would like them to be displayed, so the user does not have to click back and forth; if that makes sense.

No need in testing it Ben, I did it for you, and it WORKS! You are a genius! Do you realize there is nothing else on the internet to be found that can do what you just did; as well as your original solution to having the articles on any page. Incredible! You should be proud, I know I am very, very appreciative!!! 🙂 Thank You!

Now my next dilemma… and there always seems to be a next.. LOL! I have created PDF files for each article and would like the correct linked file to show up on the correct article page; along with the links that say ‘Add to Favorites’ and ‘Print this Article’. I have something working, but it’s more manual, it would be nice if there were a more automated solution. I’m not asking for your help, you’ve done enough, and again, I am so grateful!!! 🙂

Its a great piece of work. However, it appears like the developer has stopped maintaining it and there are not new versions for the current WHMCS version ie 5.2.5.
I think the idea was great and i would have encouraged the developer to charge some little fee to support development.
Thank You,
Mambo Web Hosting – Kenya Largest Hosting Company

Sorry, I’m afraid this was one of those projects that I just forgot about (and I’ve been terrible at checking this blog). If you ever need some custom work done, I am available for hire 🙂 – me [at] ben90 [dot] com