Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+8 votes
10.6k views
in Q2A Core by
edited by
I would like to have "Questions" before "All activity".

So basically I need to change the order.

Can someone help me with this?

4 Answers

+5 votes
by
 
Best answer

For now this has to be changed in the core source code - search for $qa_content['navigation']['main'] in function qa_content_prepare(...) in qa-page.php to see how the menu is built up. You can reorder the relevant parts of the function.

by
Thank you, I've done it!
by
edited by
Please gid, try to implement a solution in the admin panel for this. The first section of /admin/pages would be suitable. This request above is more than 2 years old ;)

Your solution is a core hack (which all should not do) and NoahY's solution below seems too heavy for such a basic thing.
by
totally agree! use numbers to order...
+1 vote
by
+1 for this feature request!

Why not have numbers in the "Administration center - Pages" for the order in the navigation?
+7 votes
by

Actually, this is pretty easy, just do something like this in your theme file:

        function nav_list($navigation, $class, $level=null)
        {
            $this->output('<UL CLASS="qa-'.$class.'-list'.(isset($level) ? (' qa-'.$class.'-list-'.$level) : '').'">');
 
            if($class=='nav-main') {
                $new_order = array('custom-1','ask','tag','unanswered','questions','user','admin','custom-6','custom-5');
                $temp_nav = array();
                foreach ($new_order as $key) {
                    if(isset($navigation[$key]))
                        $temp_nav[$key] = $navigation[$key];
                }
                $navigation = $temp_nav;
            }

            $index=0;
            foreach ($navigation as $key => $navlink) {
                $this->set_context('nav_key', $key);
                $this->set_context('nav_index', $index++);
                $this->nav_item($key, $navlink, $class, $level);
            }
 
            $this->clear_context('nav_key');
            $this->clear_context('nav_index');
            
            $this->output('</UL>');
        }

Where $new_order is an array of the items you want in the order you want them - do print_r($navigation) to see what keys are for what items.

by
Your code is working fine but unable to get custom HTML home page lable into nav link.. any idea?
by
I have same issue that custom HTML page isn't working..
–1 vote
by

This feature is implemented in my product.

by
Wow, you really should write your website in non-engrish, ie, propper english.
...