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

This is what I wanted to achieve, wrapping headline and question body into a gray DIV:

 

But it was not as easy as I thought. Problem is that there is one function called in the theme base with: $this->main_parts($content); that outputs question, all answers and comments.

In other words, you can only wrap all but not parts of it together (especially not h1 and q-view). Have a look yourself in file: qa-theme-base.php

Solution:

In function main() add the wrapping DIV before $this->page_title_error():

     // added to give h1 and q-body a gray background
     if($this->template == 'question') {
          $this->output('<div class="qa-q-body" style="background:#F5F5F5;padding:20px;">');

     }

     $this->page_title_error();
     // ....

Then you need to close the wrapping DIV in function main_parts($content) like that:

        function main_parts($content)
        {
            foreach ($content as $key => $part) {
                $this->set_context('part', $key);
                $this->main_part($key, $part);
                // added to end gray bg
                if($key=='q_view') {
                    $this->output('</div>'); // end class="qa-q-body"
                }

            }

            $this->clear_context('part');
        }


Hope this helps.
Kai

 

Q2A version: 1.6.3

Please log in or register to answer this question.

...