发新话题
打印

想问一个关于模板的问题 请大家来看看

想问一个关于模板的问题 请大家来看看

我现在在测试ECSHOP这个 第一次使用 看到官方有个pinkgirl的 这个挺不错的 但是自己没有什么美工的经验,在程序里有个精品推荐的栏目 默认好象是每行三个商品 在中间位置显示的 但是我想把它改成 每列3个只想显示一列 有4个商品 然后把这个栏目移动到 右边去和购物车 放在一排 怎么办呢??

TOP

本人不是怎么会 美工什么的 但是在首页里的 精品推荐 默认是每行三个商品横排的,但是我现在想把它边成 竖排的 是显示一列 每列显示5个商品 然后把这个栏目放在 右边

TOP

是不是在什么地方你已经发过言了,
如果你想修改让他成不竖排的,需要修改精品推荐这个lbi文件。我想你应该清楚这一点。。。

如果我记得没有错的话,精品推荐的lbi文件应该是recommend_best.lbi文件(\pinkgirl\library)这个目录下,首先我们用DW打开他。。
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <!-- {if $best_goods} -->
<table width="679" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="679" height="57" background="../images/bestproducts.gif" class="tdrepeat"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="right"><a href="../category.php?id=4"><img src="images/more.gif" width="38" height="11" border="0"></a></td>
                    <td width="40"> </td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td valign="top" background="../images/newproducts_1.gif" class="tdrepeat">

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <!--{foreach name=wrap from=$best_goods item=goods}-->
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td align="center"><A href="{$goods.url}" title="{$goods.name|escape:html}" style="color:#FE017E">{$goods.short_name|escape:html}</A></td>
        </tr>
      </table>
      <table width="135" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FBE2E5">
        <tr>
          <td height="112" align="center" bgcolor="#FFFFFF"><A href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" border="0"  onMouseOver="showtrail('{$goods.goods_img}','{$goods.name|escape:html}',{$image_width},{$image_height})"   onMouseOut="hidetrail()" /></A>
          <div id="preview_div"></div></td>
        </tr>
        <tr>
          <td align="center" bgcolor="#FFFFFF"><!-- {if $goods.promote_price neq ""} -->
            <span style="color:#FF0000"><strong>!促销:</strong></span><span style="color:#FF0000;text-decoration: underline">{$goods.promote_price}</span>
            <!-- {else}-->
            售价:<span style="color:#003366;text-decoration: underline">{$goods.shop_price}</span>
            <!--{/if}-->
            <table width="130" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center"><a href="{$goods.url}"><img src="images/sort-xiangxi.gif" alt="详细信息" width="28" height="17" border="0"></a></td>
                <td height="28" align="center"><a href="javascript:collect({$goods.id})"><img src="images/sort-collect.gif" alt="收藏" width="28" height="17" border="0"></a></td>
                <td align="center"><a href="javascript:addToCart({$goods.id})"><img src="images/sort-addcart.gif" alt="购买" width="28" height="17" border="0"></a></td>
              </tr>
          </table></td>
        </tr>
      </table></td>
    {if $smarty.foreach.wrap.iteration%4 eq 0}</tr>
  <tr>{/if}
    <!-- {/foreach} -->
  </tr>
</table>
</td>
            </tr>
</table><!-- {/if} -->

这是我曾经修改过的代码,
我们会看到如此类似的代码,我们只需要将部份的代码修改以后,就成功了,
第一个需要修改的地方就是这个表格的整个宽度,因为以前他是一个长的表格,一排可以放三个产品,而现在一排只需要排一个商品,所以需要修改他的宽度,这时候相应的图片你也需要进行修改,因为原来的图片太长,。

修改好了整个表格的宽度以后,接下就是将 <tr>
    <!--{foreach name=wrap from=$best_goods item=goods}-->
    <td>

中间的<!--{foreach name=wrap from=$best_goods item=goods}-->
移动到<tr>上面去。。。

就成了
<!--{foreach name=wrap from=$best_goods item=goods}-->
<tr>
  <td>
,还需要更改</td>
    {if $smarty.foreach.wrap.iteration%4 eq 0}</tr>
  <tr>{/if}
    <!-- {/foreach} -->
  </tr>

修改成</tr>{if $smarty.foreach.wrap.iteration%4 eq 0}</tr>
  <tr>{/if}
    <!-- {/foreach} -->
  </tr>

这样保存,上传到空间去,试试效果吧。。。。

TOP

也许不太清楚,如有什么疑问请跟帖。。。

TOP

发新话题