Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

how do I hide the new sub menu with recent hot and so on ?

+3 votes
asked Jun 14, 2011 in Q2A Core by Scott Novell
I created addon for this from below working answer.
http://answers.prothoughts.com/q2a-themes-addons
Thanks ProThoughts!

5 Answers

0 votes

I'm searching for that too, you can hide it with css but thats not a nice way.

the other option would be to delete it from the code in the file qa-theme-base.php:

function nav_main_sub()
        {
            $this->nav('main');
            $this->nav('sub');
        }

Thats where its produced, but you can't just delete that line, because it will also delete the admin-bar, so we need to get into that nav('sub'); but i dont know how, maybe some experts can help ...

answered Aug 16, 2011 by Super2Sam
This will disable admin submenu.
0 votes

If you want to do it with CSS just go to .qa-nav-sub and make it display:none;

answered Aug 16, 2011 by Super2Sam
This will disable admin submenu.
+2 votes
in a custom theme or layer:

        function nav($navtype, $level=null)
        {
            if($navtype != 'sub' || $this->template=='admin') {
                qa_html_theme_base::nav($navtype, $level=null);
            }
        }

I haven't tested it, but something like that will work.
answered Aug 16, 2011 by NoahY
I tried this, it works! Thanks!
+1 vote

You should do it within a custom theme like proposed by NoahY.
If you don't have one you could also modify the core-file:

include/qa-page-questions.php

just delete the following lines


if (!$countslugs)
  $qa_content['navigation']['sub']=qa_qs_sub_navigation($sort);

or change them into the following if you want to show the menu hot only to e.g. moderators:

if (qa_get_logged_in_level()>QA_USER_LEVEL_BASIC)
  if (!$countslugs)
    $qa_content['navigation']['sub']=qa_qs_sub_navigation($sort);

 

answered Aug 17, 2011 by snoopy0815
0 votes

To hide only one (or more) buttons from submenu, edit the file qa-app-q-list.php.

From the function qa_qs_sub_navigation, comment the lines of the button/s you want hide. For example, to hide most votes button:

 

//'votes' => array(
//'label' => qa_lang('main/nav_most_votes'),
//'url' => qa_path_html($request, array('sort' => 'votes')),
//),
 
answered 3 days ago by OscarL