Create Q2A Splashbox display on Home page

114 views Asked by At

I'm trying to get a splashbox to show ONLY on the home page between the navbar and the sidebar.

Here's a JSFiddle of what I'm trying to do..

http://jsfiddle.net/6twvzgfu/

As you can see, the splashbox is above the sidebar and content...

Now, here's the problem.

In Q2A, when I try to replicate this, the sidebar is always ABOVE the splashbox.

Here's my current code..

    function main()
    {
        if ($this->request=='') {
        $this->output('<div class="splashbox">'); 
         $this->output('</div>');     

        } else
            qa_html_theme_base::main();
    }


    function sidepanel() 
    {   
        $this->output('<div class="qa-sidepanel">'); 
        $this->search();
        $this->nav('cat', 1);
        $this->feed(); 
        $this->output('</div>'); 
    }

That way, the splashbox only shows on the home page (as declared by the '')... and that works fine. But it's rendering the sidebar (sidepanel) first. I'm not sure why. I figured putting the sidepanel function below the splashbox function would make it render second but it didn't work. Any suggestions? Thanks!

1

There are 1 answers

0
Michael Yebba Jr On

It was pretty easy... I figured it out with some time of just looking over the code..

I realize that I was making a function "MAIN"... that means that it would replace the content portion of my Q2A with the splashbox. That's not what I wanted... I wanted it to insert the splashbox into the entire site.

In order to do that, I had to make a function BODY_CONTENT, not a function MAIN

So...

this is what it ended up looking like...

        function body_content()
    {
        if ($this->request=='') {   
        $this->body_prefix();
    $this->notices();
    $this->output('<div class="qa-body-wrapper">', '');
    $this->widgets('full', 'top');
    $this->header();
    $this->output('<div class="splashbox">'); 
        $this->output('</div>');
    $this->widgets('full', 'high');
    $this->sidepanel();
    $this->main();
    $this->widgets('full', 'low');
    $this->footer();
    $this->widgets('full', 'bottom');
    $this->output('</div> <!-- END body-wrapper -->');
    $this->body_suffix(); 

        } else
            qa_html_theme_base::body_wrapper();
    }