- 浏览: 13731866 次
- 性别:
- 来自: 洛杉矶
文章分类
- 全部博客 (1994)
- Php / Pear / Mysql / Node.js (378)
- Javascript /Jquery / Bootstrap / Web (435)
- Phone / IOS / Objective-C / Swift (137)
- Ubuntu / Mac / Github / Aptana / Nginx / Shell / Linux (335)
- Perl / Koha / Ruby / Markdown (8)
- Java / Jsp (12)
- Python 2 / Wxpython (25)
- Codeigniter / CakePHP (32)
- Div / Css / XML / HTML5 (179)
- WP / Joomla! / Magento / Shopify / Drupal / Moodle / Zimbra (275)
- Apache / VPN / Software (31)
- AS3.0/2.0 / Flex / Flash (45)
- Smarty (6)
- SEO (24)
- Google / Facebook / Pinterest / SNS (80)
- Tools (22)
最新评论
-
1455975567:
xuezhongyu01 写道wocan23 写道我想问下那个 ...
Mysql: LBS实现查找附近的人 (两经纬度之间的距离) -
xuezhongyu01:
wocan23 写道我想问下那个111.1是怎么得来的我也看不 ...
Mysql: LBS实现查找附近的人 (两经纬度之间的距离) -
18335864773:
试试 pageoffice 在线打开 PDF 文件吧. pag ...
jquery在线预览PDF文件,打开PDF文件 -
青春依旧:
opacity: 0.5; 个人喜欢这种方式!关于其他css特 ...
css透明度的设置 (兼容所有浏览器) -
July01:
推荐用StratoIO打印控件,浏览器和系统的兼容性都很好,而 ...
搞定网页打印自动分页问题
How to create a new package / theme (文档下载)
http://www.siteground.com/tutorials/magento/
This is a work-in-progress. Help making this article great is requested.
The following was done with Magento v1.3.2.4.
I’ve been reading up on Magento’s packages and themes for a little while now. For the life of me, I can’t get a secondary theme to work. So I created a whole new package.
This procedure will create a minimal, 2-column (left), non-complete, bare-bones package/theme that you can then fully customize. I did it from the command-line in linux, but I suppose you could do it from FTP or SCP. Just make sure you keep the paths correct.
The reason for creating this package from scratch is so that I could get a better understanding of exactly how it works and what files do what. During this walk-through, you can reload your test Magento installation and either see a bare-bones theme, or an error message specifying the missing file. This will help you to see which files are necessary for which part of the system.
The walk-through |
1.
In your installed magento
directory, create a directory structure like this:
app + design + frontend + your_new_theme_name (package) + default (theme in your new package) + layout + template
(Note that the directory structure app/design/frontend
already exists. That’s where all themes/packages reside.)
2.
In layout
, copy these files from Magento’s default package:
catalog.xml catalogsearch.xml checkout.xml cms.xml (homepage customization/content will not work without this file) customer.xml newsletter.xml page.xml wishlist.xml (if you want wishlist capability)
The page.xml
file will be the default page layout .xml
file used for every page in your site. Other layout .xml
files will modify (or “update”) this base layout.
Example copy command in linux for this step:
cp ../../../default/default/layout/page.xml .
The above command will only work if your current directory is app/design/frontend/your_new_theme_name/default/layout
.
3.
In template
, make these directories:
callouts catalog catalogsearch checkout customer page reports review
4.
In template/callouts
, copy this file from Magento’s default package:
left_col.phtml
5.
In template/catalog
, create these directories:
navigation category (will need this to view products) product (will need this to view products)
6.
In template/catalog/navigation
, copy these files from Magento’s default package:
top.phtml left.phtml (will need this to view products)
7.
In template/catalog/category
, copy this file from Magento’s default package:
view.phtml (will need this to view products)
8.
In template/catalog/product
, copy these files from Magento’s default package:
list.phtml (will need this to view products) price.phtml (will need this to view products) new.phtml (will need this to view products on the homepage)
9.
In template/catalog/product
, create this directory:
list (will need this to view products)
10.
In template/catalog/product/list
, copy this file from Magento’s default package:
toolbar.phtml (will need this to view products)
11.
In template/catalogsearch
, copy this file from Magento’s default package:
form.mini.phtmlform.mini.phtml
12.
In template/checkout
, create these directories:
cart onepage total
13.
In template/checkout
, copy this file from Magento’s default package:
cart.phtmlcart.phtml
14.
In template/checkout/cart
, create this directory:
item
15.
In template/checkout/cart
, copy these files from Magento’s default package:
crosssell.phtml coupon.phtml shipping.phtml totals.phtml noItems.phtml
16.
In template/checkout/cart/item
, copy this file from Magento’s default package:
default.phtml
17.
In template/checkout/onepage
, copy this file from Magento’s default package:
link.phtml
18.
In template/checkout/total
, copy this file from Magento’s default package:
default.phtml
19.
In template/customer
, copy the entire directory structure from Magento’s default package:
cp -a ../../../../default/default/template/customer/* .
This will copy the following files/directories from /template/customer
:
.: account/ address/ address.phtml balance.phtml dashboard.phtml form/ logout.phtml order/ orders.phtml widget/ wishlist.phtml ./account: dashboard/ dashboard.phtml link/ navigation.phtml ./account/dashboard: address.phtml hello.phtml info.phtml newsletter.phtml sidebar.phtml ./account/link: back.phtml ./address: book.phtml edit.phtml ./form: address.phtml confirmation.phtml forgotpassword.phtml mini.login.phtml newsletter.phtml changepassword.phtml edit.phtml login.phtml mini.newsletter.phtml register.phtml ./order: view.phtml ./widget: dob.phtml name.phtml taxvat.phtml
20.
In template/page
, copy these files from Magento’s default package:
1column.phtml (used for the login screen and only a few other places) 2columns-left.phtml (used for virtually every page in your store)
21.
In template/page
, create these directories:
html switch template
22.
In template/page/html
, copy these files from Magento’s default package:
breadcrumbs.phtml footer.phtml header.phtml head.phtml notices.phtml
23.
In template/page/switch
, copy these files from Magento’s default package:
languages.phtml stores.phtml
24.
In template/page/template
, copy this file from Magento’s default package:
links.phtml
25.
In template/reports
, copy this file from Magento’s default package:
home_product_viewed.phtml
26.
In template/review
, make this directory:
helper
27.
In template/review/helper
, copy this file from Magento’s default package:
summary_short.phtml
28. In Magento’s admin, set your new package:
a. System → Configuration
b. In the upper-left area, set the configuration scope,
c.
Click on Design
, in the Package
section enter your_new_theme_name
in Current package name
.
Now go to your storefront and reload. You should be looking at the default Magento theme without the images. In this walk-through, none of the images were copied over (intentionally) so that you can start with a nearly-blank theme and build it up to what you want from there.
Disabling Specific Features |
For our site, we don’t have any coupons, so I turned off the coupons feature by editing layout/checkout.xml
and commenting-out this line:
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
It’s not necessary to comment-out the line in template/checkout/cart.phtml
which calls ‘coupon’ (but you could if you wanted to):
<?php echo $this->getChildHtml('coupon') ?>
We also don’t need or want the “crosssell” section, so while I was in layout/checkout.xml
I commented-out that line as well.
How to turn on 'Template Path Hints' |
When viewing your theme, it’s helpful to see which template file is being used for which part of the page. Magento has an excellent debugging tool called ‘Template Path Hints’.
1. Admin → System → Configuration .
2. Select your store from the drop-down in the upper-left corner and wait for the page to reload. Note that you have to be on the website level or lower. The ‘Template Path Hints’ option will not be visible if you are at a higher level.
3. Advanced → Developer (all the way at the bottom).
4. Template Path Hints → Yes .
5. Hit the orange Save Config button.
Go to your store and reload. You should see path specs in dashed boxes
around all sections of the page. These paths tell you which template .phtml
file is responsible for that section.
How to turn off Magento's cache |
When developing a theme/package, it’s helpful to not have to wait for your changes to expire the built-in cache. Here’s how to disable Magento’s cache so that you can see your changes right away:
1. Admin → System → Cache Management
2. In the Cache Control section, for the All Cache drop-down, select Disable .
3. Click the orange Save Cache Settings button.
How to set the header details |
If you open up /app/design/frontend/your_new_theme_name/default/template/page/html/header.phtml
, you’ll see a line like this:
<h1 id="logo" ><a href="<?php echo $this->getUrl('') ?>" > <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /> </a></h1>
Where does Magento get the value for getLogoSrc()
and getLogoAlt()
when building your logo image? This information is not in the template
(though it could be). Instead, it’s in the admin section:
1. Admin → System → Design → section Header .
You could put the exact data directly into your header.phtml
file, but then you’d have to edit the file by hand every time there
were a change to the image. Having the data in the admin section gives
you an easy-to-use web-interface for modifying the data.
Also in this header.phtml
file is this code:
<?php echo $this ->getWelcome ( ) ?>
This “Welcome Text ” is also defined in the Header section.
- magento-theme.zip (450.1 KB)
- 下载次数: 6
- 制作你自己的Magento主题.zip (116.5 KB)
- 下载次数: 2
- magento-help.zip (2.5 MB)
- 下载次数: 1
发表评论
-
Magento: 后台显示图片不能找到 Image file was not found on product tab
2016-08-30 02:22 2948I was uploading some images f ... -
理解WordPress的PingBack和TrackBack
2016-08-26 02:21 5740pingback和trackback的功 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(四)
2016-06-07 11:40 1026自上一篇之后,5天过去了,这篇文章总算是挤出来了... 其实 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(三)
2016-06-07 11:41 2051原则上WDCP安装好了,就可以直接使用了,FTP、MySQL ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(二)
2016-06-07 01:33 1004上一篇讲到,主机正常运转了。但是此时如果直接访问公网IP是 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(一)
2016-06-07 01:31 21644现在小站唯一的流量都靠AWS这个关键词了,刚好要用AWS重新 ... -
零基础 Amazon Web Services (AWS) 入门教程 (列表)
2016-06-07 01:32 2084在 Amazon Web Services 上托 ... -
Magento 1.9:新订单通知 Admin Order Notifier
2016-06-02 02:48 848Here is a little Mag ... -
Magento 1.9.X 系列教程
2016-05-14 02:44 2292Magento安装下载教学: Magento教程 1 ... -
Magento: 产品页面下jquery change函数失效 Call javascript function onchange product option
2016-05-05 06:39 1757明显的原因是change函数跟magento默认的oncha ... -
Magento: 判断是否为手机浏览 Optimise Web's Mobile Detect Class for Magento
2016-04-29 07:01 1168项目地址:Optimise Web's Mobile Det ... -
Magento: Gird 和 form 区域 Module Development Series – Magento Admin Module
2016-04-28 02:39 678In this tutorial, we are goi ... -
Magento: addAttributeToFilter 和 addFieldToFilter 的区别 Difference between addAttri
2016-04-28 02:34 1020addAttributeToFilter is use ... -
Magento: 后台获取menu链接 Getting the admin panel urls
2016-04-28 02:34 778The url for customer page in t ... -
Magento : 调用文件上传 upload file frontend
2016-04-27 01:25 1364bool mkdir ( string $pathname ... -
Magento: 自定义用户登录导向页面 Redirect Customer to Previous Page After Login
2016-04-26 02:45 1860Configuration Settings – L ... -
Magento: 代替flash上传 How to disable Flash uploader in Magento (product images and
2016-04-06 05:04 11201. 替换产品页flash上传按钮 - 使用 Du ... -
Magento: 在客户账户中添加自定义链接 My Account Add Link
2016-04-05 14:05 1254This extension add new link an ... -
Magento: 根据产品属性加载产品信息 Load A Category or Product by an Attribute
2016-03-26 01:35 948Load a Product by ID <?ph ... -
Magento模块开发之数据库SQL操作方法说明
2016-03-26 01:31 1367今天主要来看Magento中的Mysql4/Resource ...
相关推荐
How to Create a Database in Python using SQL Lite 3 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
启示录 第二版 Marty Cagan(压缩卷第一部分,共三部分)
How to create toolbars with spinners and/or sliders(48KB)
how to create my appidshow to create my appidshow to create my appids
Charts I- How to create a chart.xlt
You will learn about the basic plots, how to customize them, and combine them to make sophisticated figures. Along with basic plots, you will also learn to make professional scientific plots.
How to Create a Healthy Plate - English.srt
How to create a donut chart like this in chart.js
this book tell you How to Create a Simple Web Dynpro Application for java,not for ABAP
Charts I- How to create a chart(2).xlt
This program shows you how to create a sample project that adds print preview capabilities to your Visual Basic program by using a generic object and the Printer object.
启示录 第二版 Marty Cagan (压缩卷第二部分,共三部分) INSPIRED_ How to Create Tech Products Customers Love, 2nd Edition part2.rar
How to Create a Database in Python using SQL Lite 3 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
An example of how to create a coolbar such as the one in Internet Explorer without using a 3rd party control.
How to Create a Database in Python using SQL Lite 3 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书