Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+8 votes
7.4k views
in Q2A Core by
is it possible to show the content of the question on question list?  including the image and text?

3 Answers

–2 votes
by
i need that too plz someone answer
+6 votes
by
edited by

I have posted a solution 2 or 3 months ago, please check my question you will find the solution. I am using this feature in my theme tovolt.

You need a simple hack in mouseover layer plugin,

ok here is the solution:

open qa-mouseover-layer.php

and find $q_list['qs'][$index]['title']='<SPAN TITLE="'.qa_html($text).'">'.@$question['title'].'</SPAN>';

and now replace that with:

$q_list['qs'][$index]['content']='<p class="q-list-content">'.qa_html($text).'</p>';

and then in question list add ['content'] just below title

done.

by
thanks for your answer i need the same fo my website
So where i will pute ['content'] ??
by
Hello Aryan,
I dont know where add  ['content']  . Wich qa page i need include  ['content'] ????
Thanks friend!
Maver
by
where i have to pute [content] ? Thanks
+1 vote
by
My answer to deleted with another question due to the server breakdown in end of Jan 2014. So this is the way I can propose. Use an advanced theme and override function q_item_title($q_item) like that:

/* Question Content below Question Title */

function q_item_title($q_item) {

    $blockwordspreg = qa_get_block_words_preg();
    $maxlength = qa_opt('mouseover_content_max_len');
    
    $result=qa_db_query_sub('SELECT postid, content, format FROM ^posts WHERE postid IN (#)', $q_item['raw']['postid']);
    $postinfo=qa_db_read_all_assoc($result, 'postid');
    $thispost=@$postinfo[$q_item['raw']['postid']];
    
    $text = qa_viewer_text($thispost['content'], $thispost['format'], array('blockwordspreg' => $blockwordspreg));
    $text = strip_tags($text); // removes all img, p, etc. tags
    $text = qa_shorten_string_line($text, $maxlength);
    $q_preview = '<p>'.qa_html($text).'</p>'; // for full question content use: $thispost['content']

    $this->output(
        '<div class="qa-q-item-title">
        <a href="'.$q_item['url'].'">'.$q_item['title'].'</a>'
        .$q_preview.
        '</div>'
    );
}

This gives you a preview text. If you want the img tags and other tags to appear, remove strip_tags.

Hope that helps,
Kai
...