顯示具有 zencart學習 標籤的文章。 顯示所有文章
顯示具有 zencart學習 標籤的文章。 顯示所有文章

2010年1月2日 星期六

讓不同瀏覽器讀取不同的css設定

只要在css屬性前加上 # <---ie7.0以上使用 或是_ <---ie6.0使用 即可,例:
#style {
margin: -5px 0 15px 0;
/* firefox 將會使用這一行設定 */
#margin:0px;
/* IE7.0以上 將會使用這一行設定 */
_margin:0px;
/* IE6.0 將會使用這一行設定 */
}

2009年10月4日 星期日

zen cart上加入flash header的方法

1.先把flash檔案上傳至自己模板的空間,例如:
includes/templates/YOUR_TEMPLATE/images/flash/YOUR_HEADER.swf


2.用Dreamweaver 開新檔案,置入flash檔案,然後存檔,dreamweaver會自動詢問要不要產生swfobject.js的資料夾
跟檔案,按確定儲存。


3.把剛剛由dreamweaver得來的檔案存到自己模板內的空間,如:
includes/templates/YOUR_TEMPLTE/Scripts/swfobject.js 


4.如果先前tpl_header.php檔案沒有被修改過,那麼先複製
includes/templates/template_default/common/tpl_header.php 
這個檔案  到自己的模板資料夾內,如下
include/templates/YOUR_TEMPALTE/common/tpl_header.php


5.打開剛剛複製的tpl_header.php,然後將dreamweaver上的置入flash所需要的code拷貝到適當位置(例如/將code寫在branding display內),如下:


<!--bof-flash_head display-->
<div style="float:left">
<script src="includes/templates/btp/Scripts/swfobject_modified.js" type="text/javascript"></script>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="680" height="250">
      <param name="movie" value="includes/templates/btp/images/swf/header680x250.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don¡¦t want users to see the prompt. -->
      <param name="expressinstall" value="includes/templates/btp/Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="includes/templates/btp/images/header680x250.swf" width="680" height="250">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
</div>
<!--eof-flash_head display-->



6.修改code內的檔案指向,讓他們指向swf檔案以及Scripts在自定模板資料夾內的位置。



======= END =======



2009年9月25日 星期五

Zencart內自己建立側邊欄位Sideboxes

要建立自己的側邊欄位,首先
1.在自己的模組資料夾內建立一個sideboxes的資料夾。
2.一個側邊欄位的建立需要包含連結以下三個檔案











  • modules/sideboxes/template_name/name_of_sidebox.php'
  • languages/english/extra_definitions/template_name/ name_of_sidebox_defines.php '
  • templates/template_name/sideboxes/tpl_name_of_sidebox.php '


將上述的template_name改成自己的模組名稱


如何建立這些連結檔案呢?假設我們要建立一個叫my_sidebox的側邊欄位,那麼在
modules/sideboxes/template_name/my_sidebox.php  應該這樣寫:








<?php
 $show_my_sidebox = true;
 if ($show_my_sidebox == true){
 require($template->get_template_dir('tpl_my_sidebox.php', DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_my_sidebox.php');
 $title = BOX_HEADING_MY_SIDEBOX;
 $left_corner = false;
 $right_corner = false;
 $right_arrow = false;
 require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . 
$column_box_default);
  }
 ?>


3.接著建立定義這個側邊欄位的標題名稱的檔案於includes/languages/english/extra_definitions/packt/my_sidebox_defines.php

<?php
  define('BOX_HEADING_MY_SIDEBOX', 'My Sidebox');
 ?>



4.然後開始建立 includes/templates/packt/sideboxes/tpl_my_sidebox.php這個檔案,如下:







<?php
  $content = "This is my first Sidebox. I have created it in 5 minutes. Although it is not of practical use yet, I 
 hope I can eventually build a good sidebox.";
 ?>


之後在到購物網站的後台管理界面,將側邊欄位開啓,即可看到~