Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by

I'm really stuck with this :(.

I'm trying to load the overview of a single question, much like you would find on the front page of Q2A, but a single question instead of a list, and in a blank page.

So far I have been able to load the single question template when I use the request 'embed' as follows:

function body_content() {



if (!empty($embed)){

$this->template == 'questions';



this->output('Regular body');



However when I call this in to effect with a url such as: http://www.mydomain.com/?qa=1&qa_1=how-to-embed-a-single-question&embed=yes

The singular question template 'q_item_main()' is full of 1s!.

Does anybody know how to pass the correct information for a desired question q_item_main(HERE) ?

Or is there something else I should be doing to load a single question overview ?

Thank you kindly :D

1 Answer

–1 vote

Changing $this->template won't help at this point, since qa_content has already been created based on the current request.

$this->template == 'questions'; is equivalent to writing either:




depending on the value of $this->template, and is meaningless in terms of the running of the code (removing one = sign would help, but it still won't have an effect on qa_content).

What you need to do, I think, is to access the ^posts database directly, pull up a question, create an array, and pass it to qa_item_main();

Hi Noah

Yes you have summerised the question very well :), but I have no idear how to call the correct things from the database with something like:


Hence the question :(.
edited by
Noah, please stop sending me abusive messages, and replying to my questions with comments to get points and prevent me from getting real answers, in your last answer you said "I don't understand the question for example.
This time you have spammed me abuse, I don't know what it is that is wrong with you, and I don't care, just quit trolling.