Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Q2A Core by

For another forum I had to start using categories.

Problem is that I do not see a widget in admin/layout ?

I'd like to change the position to page top, not sidebar. How to do it?

Q2A version: 1.6.2

2 Answers

0 votes
by
Indeed, the categories are not currently implemented as a widget. They are a type of navigation and their position is fixed in the sidebar.
by
yep, thought so ;) Here is a simple block of code to output the categories in an advanced theme: http://www.question2answer.org/qa/29165/list-all-categores-in-advanced-theme

For now it might help. For later, it would be better to have this as a widget I guess.
+2 votes
by
edited by

In qa-theme.php

The default layout is shown below:

        function sidepanel()
        {
            $this->output('<div class="qa-sidepanel">');
            $this->widgets('side', 'top');
            $this->sidebar();
            $this->widgets('side', 'high');
            $this->nav('cat', 1);
            $this->widgets('side', 'low');
            $this->output_raw(@$this->content['sidepanel']);
            $this->feed();
            $this->widgets('side', 'bottom');
            $this->output('</div>', '');
        }

 

Categories moved to top of side bar- shown below:

        function sidepanel()
        {
            $this->output('<div class="qa-sidepanel">');
            $this->widgets('side', 'top');
            $this->nav('cat', 1);
            $this->sidebar();
            $this->widgets('side', 'high');
            $this->widgets('side', 'low');
            $this->output_raw(@$this->content['sidepanel']);
            $this->feed();
            $this->widgets('side', 'bottom');
            $this->output('</div>', '');
        }

 

 

Alternatively try adding this to change position to any of the current widget positions ....

 

        function main()
        {
            $content=$this->content;

            $this->output('<div class="qa-main'.(@$this->content['hidden'] ? ' qa-main-hidden' : '').'">');
            
            $this->widgets('main', 'top');
            

            $this->nav('cat', 1);


            $this->page_title_error();        
            
            $this->widgets('main', 'high');

            /*if (isset($content['main_form_tags']))
                $this->output('<form '.$content['main_form_tags'].'>');*/
                
            $this->main_parts($content);
        
            /*if (isset($content['main_form_tags']))
                $this->output('</form>');*/
                
            $this->widgets('main', 'low');

            $this->page_links();
            $this->suggest_next();
            
            $this->widgets('main', 'bottom');

            $this->output('</div> <!-- END qa-main -->', '');
        }

 

and delete the default position with

 

        function sidepanel()
        {
            $this->output('<div class="qa-sidepanel">');
            $this->widgets('side', 'top');
            $this->sidebar();
            $this->widgets('side', 'high');
            //  $this->nav('cat', 1);
            $this->widgets('side', 'low');
            $this->output_raw(@$this->content['sidepanel']);
            $this->feed();
            $this->widgets('side', 'bottom');
            $this->output('</div>', '');
        }

 

Monty and Bex

by
thanks for the info :)
...