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

Hi there!

How to add below Question post (not questions list) :  "Browse other questions tagged 'get tags from post' or ask a question"

Q2A version: Last one
by
Do you mean to add a message suggesting tag search? Suggesting to visit the full list of questions is redundant.
by
edited by
Hi Ronlaw, well yes, a message suggestion 'tag search' exactly like in the picture. Why? because if the content is very long (and in my Q2A subject people may write a lot), then I plan to add this below content not to lose people, you know what I mean?
by
moved by

I had this =>

$qa_content['suggest_next']=qa_html_suggest_qs_tags(qa_using_tags();

in bottom of qa-page-question.php, but it doesn't show tags, but a link to full list of question. Maybe someone can call Tag from the page, just here? How to call tags?

by
edited by
well it doesn't really help me bro, I would like to get all Tags from the page, below.

1 Answer

+3 votes
by
selected by
 
Best answer

My example code: (Add your theme.php)

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 = 'Browse other questions tagged';
        foreach($content['q_view']['q_tags'] as $key => $tagshtml)
          $suggest .= ' '.$tagshtml;
        $suggest .= ' or ';
        $suggest .= '<a href="'.qa_path_html('ask', strlen($categoryid) ? array('cat' => $categoryid) : null).'">';
        $suggest .= qa_lang_html('main/nav_ask');
        $suggest .= '</a>';
      }
    }
    $content['suggest_next']=$suggest;
  }
  qa_html_theme_base::main();
}
As for this sample, display and link change by the use situation of category and tags. You should test it with your environment.
by
edited by
Hi Sama, firstofall, thanks for you great help. I tried to paste this in my qa-theme.php , but nothing happened. I think I paste it in the right place... but nothing change in question page or anywhere else.
by
Sorry it's works! Just perfect! It was because I didn't replace it by the other function! Thanks a million man, you really help me!
...