我正在尝试找出如何在 3 列布局中覆盖主列和左侧边栏空间的一些内容。 页面的第一部分有 3 列,下部有 2 列带左侧边栏。
这是我的主页,我不需要新的布局,因为主页是唯一使用当前 3 栏布局的页面。
获得此设计的最佳方法是什么?
是否可以将其作为静态 block ?
最佳答案
作为第一步,我已将其添加到/app/etc/local.xml
<cms>
<layouts>
<homepage>
<label>Home Page</label>
<template>page/home-page.phtml</template>
<layout_handle>home_page</layout_handle>
</homepage>
</layouts>
</cms>
并创建了一个名为 home-page.phtml 的 3 列布局的副本:
app\design\frontend......\template\page\home-page.phtml
现在我有一个新的布局,但不幸的是我不知道如何编辑才能得到结果。
问这个我有点不自在,但我对布局设计真的很陌生,我不知道如何编辑我的新主页.phtml,希望你能理解我。
文件看起来像这样:
<head>
<?php echo $this->getChildHtml('head') ?>
</head>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices') ?>
<div class="centerbg">
<div class="bottombg">
<div class="topcurve">
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col3-layout">
<div class="main">
<div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div>
<div class="col-main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div></div></div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
我想我也需要新的 CSS 类,对吗?
关于css - 覆盖主列和左侧边栏的静态 block (在 3 列布局中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10451117/