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

Hi everyone,

How to move "TAGS" to the TOP in all "questions pages"? Like This =>

PS: I got thos function in my new q2a advance theme, but didnt know how to edit this :

 function main() {
      if($this->template == 'question') {
        $content = &$this->content;
        $categoryid = @$content['q_view']['raw']['categoryid'];
        $suggest = qa_html_suggest_ask($categoryid);
        if(qa_using_tags() && isset($content['q_view']['q_tags'])) {
          if(count($content['q_view']['q_tags'])) {
            $suggest = 'Compare Best Cheap Insurance Companies Quotes & Loans Online =>';
            foreach($content['q_view']['q_tags'] as $key => $tagshtml)
              $suggest .= ' '.$tagshtml;
          }
        }
        $content['suggest_next']=$suggest;
      }
      qa_html_theme_base::main();
    }

1 Answer

+2 votes
by
selected by
 
Best answer

If you have a custom theme then it is very much like guessing what the fix should be. I can tell you how to fix this using no theme at all but if you already have something there, whithout knowing what it is it is impossible to provide a working solution.

Assuming there is nothing in your qa-theme.php file you should just add this function to it:

function q_view_main($q_view) {
    $this->output('<div class="qa-q-view-main">');
    if (isset($q_view['main_form_tags']))
        $this->output('<form '.$q_view['main_form_tags'].'>');
    $this->post_tags($q_view, 'qa-q-view');
    $this->view_count($q_view);
    $this->q_view_content($q_view);
    $this->q_view_extra($q_view);
    $this->q_view_follows($q_view);
    $this->q_view_closed($q_view);
    $this->post_avatar_meta($q_view, 'qa-q-view');
    $this->q_view_buttons($q_view);
    $this->c_list(@$q_view['c_list'], 'qa-q-view');
    if (isset($q_view['main_form_tags'])) {
        $this->form_hidden_elements(@$q_view['buttons_form_hidden']);
        $this->output('</form>');
    }
    $this->c_form(@$q_view['c_form']);
    $this->output('</div> <!-- END qa-q-view-main -->');
}
 
As you can see it is the same as a function with the same name in qa-theme-base.php but with this line $this->post_tags($q_view, 'qa-q-view'); slightly moved up. This does the trick in, for instance, snow theme. Chances are it might also help you.
by
thanks Pupi, I found it!
...