首页替换
自定义首页content内容
在cms-->>page 新建首页
在content 里加入
--------------------------
<div class="col-left side-col">
<p class="home-callout"><a href="{{store direct_url="apparel/shoes/womens/anashria-womens-premier-leather-sandal.html"}}"><img src=\'#\'" url='images/ph_callout_left_top.gif'}}" border="0" alt="" /></a></p>
<p class="home-callout"><img src=\'#\'" url='images/ph_callout_left_rebel.jpg'}}" border="0" alt="" /></p>
{{block type="tag/popular" template="tag/popular.phtml"}}</div>
<div class="home-spot">
<p class="home-callout"><img src=\'#\'" url='images/home_main_callout.jpg'}}" border="0" alt="" width="470" /></p>
<p class="home-callout"><img src=\'#\'" url='images/free_shipping_callout.jpg'}}" border="0" alt="" width="470" /></p>
<div class="box best-selling">
<h3>Best Selling Products</h3>
<table border="0" cellspacing="0">
<tbody>
<tr class="odd">
<td><a href="{{store direct_url="sony-vaio-vgn-txn27n-b-11-1-notebook-pc.html"}}"><img class="product-img" src=\'#\'" url='images/media/best_selling_img01.jpg'}}" border="0" alt="" width="95" /></a>
<div class="product-description">
<p><a href="{{store direct_url="sony-vaio-vgn-txn27n-b-11-1-notebook-pc.html"}}">Sony VAIO VGN-TXN27N/B 11.1" Notebook PC</a></p>
<p>See all <a href="{{store direct_url="electronics/computers/laptops.html"}}">Laptops</a></p>
</div>
......................................................
============================================
default使用这种方式。
或者加入:
-----------------------------------------
{{block type="core/template" template="sample/home.phtml"}}============================================
意思是:在首页的内容区块里加入新的区块,template 为调用的模板
content讲显示home.phtml里的内容:
-------------------------------------------
<div style=" float:left; width:653px;">
<img src=\'#\'" echo $this->getSkinUrl('images/media/home_co_main.jpg');?>" alt="" />
</div>
<div style="float:right; width:280px;">
<div style="margin:0 0 10px;" ><img src=\'#\'" echo $this->getSkinUrl('images/media/home_co_tr.gif');?>" alt="" /></div>
<!-- div><img src=\'#\'" echo $this->getSkinUrl('images/media/home_co_br.gif');?>" alt="" /></div -->
</div>
<div class="clearer"></div>
<div style="margin:10px 0 0;"><img src=\'#\'" echo $this->getSkinUrl('images/media/home_co_bottom.gif');?>" alt="" /></div>
==================================================
modern使用这种方式
或者加入
--------------------------
{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="35"}}
===========================================
category_id为要显示商品所在的category的id,在catalog-->>categories里建立。
直接写+引入block
-------------------------------------------------
<div id="slider-wrap" class="slider-wrap" style="overflow: hidden; height: 280px;">
<div id="slider-content" class="slider-wrap"> <a href="#"><img src=\'#\'" url="bluescale/01.jpg"}}" alt="" width="741" height="280" /></a> <a href="#"><img src=\'#\'" url="bluescale/02.jpg"}}" alt="" width="741" height="280" /></a><a href="#"><img src=\'#\'" url="bluescale/03.jpg"}}" alt="" width="741" height="280" /></a></div>
</div>
<p class="home-callout"><a href="{{store direct_url="apparel/shoes/womens/anashria-womens-premier-leather-sandal.html"}}"><img src=\'#\'" url='images/ph_callout_left_top.gif'}}" border="0" alt="" /></a></p>
<div class="best_sellers_title"><span>Our Best Sellers</span></div>
<div>
{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="30" column_count="5"}}</div>
=====================================================
引入图片的方法:
{{skin url=''}}
skin文件夹下的模板名images文件夹
在Design下可以引用区块:
layout 选择 主页的布局,引用哪一个首页模板
layout update xml 可以 引用区块,以改变首页的显示
----------------------------------------------
<reference name="content">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page"><action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action></block>
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new"><action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action></block>
<block type="reports/product_compared" name="home.reports.product.compared" template="reports/home_product_compared.phtml" after="product_viewed"><action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action></block>
</reference><reference name="right">
<action method="unsetChild"><alias>right.reports.product.viewed</alias></action>
<action method="unsetChild"><alias>right.reports.product.compared</alias></action>
</reference>
=================================================
修改首页的左边栏
1 用静态区块
在cms-->>添加 static blolck
home_left_info
-------------------------------------------
<p><img src=\'#\'" url="images/media/home_co_tr.gif"}}" alt="" /></p>
<p> </p>
<p><img src=\'#\'" url="images/media/home_co_br.gif"}}" alt="" /></p>
==============================================
在cms-->>page里的 home page的design
--------------------------------------------------
<reference name="left">
<block type="cms/block" name="home_page_left_block" after="left_info_block">
<action method="setBlockId"><block_id>home_page_left_block</block_id></action>
</block>
</reference>
===========================================