Php 在主页上创建Splashbox显示

Php 在主页上创建Splashbox显示,php,question2answer,Php,Question2answer,我试图让一个splashbox只显示在导航栏和侧边栏之间的主页上 下面是我想做的一小部分 如您所见,splashbox位于侧边栏和内容上方 现在,问题来了 在Q2A中,当我尝试复制这一点时,侧栏总是位于splashbox上方 这是我目前的代码 function main() { if ($this->request=='') { $this->output('<div class="splashbox">');

我试图让一个splashbox只显示在导航栏和侧边栏之间的主页上

下面是我想做的一小部分

如您所见,splashbox位于侧边栏和内容上方

现在,问题来了

在Q2A中,当我尝试复制这一点时,侧栏总是位于splashbox上方

这是我目前的代码

    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>'); 
    }
函数main()
{
如果($this->request==''){
$this->output(“”);
$this->output(“”);
}否则
qa_html_theme_base::main();
}
函数侧面板()
{   
$this->output(“”);
$this->search();
$this->nav('cat',1);
$this->feed();
$this->output(“”);
}

这样,splashbox只显示在主页上(由“”声明)。。。这很好。但它首先渲染侧栏(侧面板)。我不知道为什么。我想把侧面板函数放在splashbox函数下面会让它以第二种方式渲染,但它不起作用。有什么建议吗?谢谢

这很容易。。。我花了些时间看了看代码就明白了

我意识到我在做一个函数“MAIN”。。。这意味着它将用splashbox替换Q2A的内容部分。那不是我想要的。。。我想让它将splashbox插入整个站点

为了做到这一点,我必须制作一个函数BODY_CONTENT,而不是一个函数MAIN

所以

这就是它最后的样子

        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();
    }
function body_content()
{
如果($this->request==''){
$this->body_prefix();
$this->notices();
$this->output(“”,”);
$this->widgets('full','top');
$this->header();
$this->output(“”);
$this->output(“”);
$this->widgets('full'、'high');
$this->sidepanel();
$this->main();
$this->widgets('full','low');
$this->footer();
$this->widgets('full','bottom');
$this->output(“”);
$this->body_后缀();
}否则
qa_html_theme_base::body_wrapper();
}