Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
I want to add some text in the sidebar which should be shown in the sidebar when you click on a particular category only. How can I do this?
Q2A version: 1.5.4

1 Answer

+1 vote
edited by
Best answer

Ok, as we had the pleasure before with Your question 


we can go ahead with the modification to achieve that the category description gets printed out in Your sidepanel when You are on a category page.

In admin menu You can add a description to each category, I think it is up to 1000 characters. The way I am using here is the best I found, it still may be that there are better ways to solve it, but this is the best I can offer for now.

Now please modify and add the sidepanel function in Your qa-theme.php as follows just before the closing }


function sidepanel()
            $this->output('<DIV CLASS="qa-sidepanel">');
            $this->widgets('side', 'top');
            $this->widgets('side', 'high');
            if (qa_request_part(0)==''){
            $this->nav('cat', 1);
if ( (isset($this->content['categoryids'])) && (!empty($this->content['categoryids']))  && ($this->template=='qa')){
$mycategoryid = end($this->content['categoryids']);
$mycatgeorycontentholen = qa_db_query_sub("SELECT content FROM ^categories WHERE categoryid =  '$mycategoryid' ");
$mycatgeorycontent = qa_db_read_one_value($mycatgeorycontentholen,true);
            $this->widgets('side', 'low');
            $this->widgets('side', 'bottom');
            $this->output('</DIV>', '');
That should do it. New readers please read the question mentioned above as well.
Further reading: