【问题标题】:Magento homepage layoutMagento 主页布局
【发布时间】:2015-03-04 15:57:47
【问题描述】:

对于我的项目http://www.merekhayaal.com/ (Magento CMS),我正在尝试让 Masonry 布局和产品滑块全宽。它们目前是 960px,这是因为它们包含在 div 'main' 中。 Masonry 布局正在从“内容”类中获取其图像,该类显然链接到“内容”>“主页”>“页面”>“CMS”>“Magento”。

当我尝试将 1column.phtml 中的“内容”类移动到“主”外部(其宽度设置为 960 像素)时,我得到了想要的结果,但它也会导致其他页面中的内容,如联系我们等全宽,这打破了网站设计。 div 是否可能比其父 div 大?有什么建议我该怎么办?

【问题讨论】:

    标签: html xml magento


    【解决方案1】:

    最好的解决方案是创建一个新布局,专门删除包含的 div “main”,并将其分配给您的主页。

    有关如何创建新布局模板的文档: http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/0_-_theming_in_magento/adding_cms_layout_templates

    【讨论】:

      【解决方案2】:

      我正在运行一个类似的解决方案,我做了以下操作:克隆 [package]/[theme]/template/page 中所需的 [layoutcolumn].phtml 并将滑块块放在 div page 中,如下所示:

       <div class="page">
              <?php echo $this->getChildHtml('header') ?>
      
              <div class="main-container col1-layout">
                  <div class="main">
                      <?php echo $this->getChildHtml('breadcrumbs') ?>
                  </div>
              </div>
      
              <?php echo $this->getLayout()->createBlock('[myslide]/[myslide]')->setTemplate('[myslide]/[myslide].phtml')->toHtml();?>
      
              <div class="main-container col1-layout">
                  <div class="main">                                
                      <div class="col-main">
                          <?php echo $this->getChildHtml('global_messages') ?>
      
                          <?php echo $this->getChildHtml('content') ?>
                      </div>
                  </div>
              </div>
              <?php echo $this->getChildHtml('footer_before') ?>
              <?php echo $this->getChildHtml('footer') ?>
              <?php echo $this->getChildHtml('global_cookie_notice') ?>
              <?php echo $this->getChildHtml('before_body_end') ?>
          </div>
      

      所以我没有输掉其他积木的设计。 我不知道这是否是最好的解决方案,但它确实有效。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-12-11
        • 1970-01-01
        • 2018-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多