Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
2.2k views
in Plugins by
How can I add  a sub menu for every tag ?

2 Answers

+1 vote
by
selected by
 
Best answer
You should be able to do this in a theme or layer plugin, so you don't need core hacks.

In one of the early functions (e.g. doctype) or the class constructor, check the current page in $this->template or $this->request.

Then if you're on the right page you can modify $this->content which is the same as $qa_content from that file. Something like

$this->content['navigation']['sub'] = array(...);
0 votes
by
I add this at the end of qa-page-tag.php before 'return...'

        $request='tag';
        $request.='/'.$tag;
                
            $qa_content['navigation']['sub']=array(
            'by-newest' => array(
                'label' => qa_lang('newest'),
                'url' => qa_path_html($request),
            ),
            
            'by-unanswer' => array(
                'label' => qa_lang('unanswer'),
                'url' => qa_path_html($request, array('by' => 'unanswered')),
            ),
            
            'by-answers' => array(
                'label' => qa_lang('answers'),
                'url' => qa_path_html($request, array('by' => 'answers')),
            ),
            
            'by-upvotes' => array(
                'label' => qa_lang('votes'),
                'url' => qa_path_html($request, array('by' => 'upvotes')),
            ),
        );

 

you can make a plugin for it too http://qa-themes.com/forums/topic/tutorial-overriding-q2a-pages
...