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 i can change question list shown at index page ?

+1 vote
I want to display for example questions with most views (questions?sort=views) or unanswered questions in index (homepage) page how can do that ?
asked Jul 31, 2011 in Q2A Core by Another one

1 Answer

+2 votes
 
Best answer

Assuming you're in Q2A 1.4, use $QA_CONST_PATH_MAP in qa-config.php to map the questions or unanswered page to the home page, for example:

$QA_CONST_PATH_MAP=array(
  'questions' => '',
);
 
Then, if necessary, you can change the default sort order in qa-page-questions.php by adding this line before switch ($sort):
 
if (!isset($sort)) $sort='views';
 
You'll also need to change qa_qs_sub_navigation() in qa-app-q-list.php to add an explicit sort parameter onto the 'recent' item, like in the other items.
answered Aug 1, 2011 by gidgreen
Yes, that should work too, until you upgrade Q2A.
This is so simple! :) I used that map just to renamed the links, didn't think of using it that way. Maybe you should put that in the method's comment Gidgreen! Works like a charm.