Magento Terms
Theme - ประกอบด้วย templating files (layout, template, locale) และ skin
app/design - controls how the pages are render
skin - controls visual components
Block - เป็นส่วนประกอบย่อย ที่มีหน้าที่เฉพาะอย่างของใครของมัน มี 2 ประเภท คือ
- Structural Block - กำหนดโครงสร้างของหน้า เช่น header, footer, left, main area
- Content Block - กำหนด actual content ของ structural block อีกทีหนึ่ง
Layout - เป็นไฟล์ที่ map ระหว่าง structural block และ content block มี 2 หน้าที่คือ define block ทั้งสองประเภทและกำหนดความสัมพันธ์ระหว่าง block แต่ละ module ใน magento จะมี layout file ของตัวเอง เช่น catalog จะมี catalog.xml
Handles - ในแต่ละ layout จะมีการแยกย่อยเป็น handle หลายๆอัน เช่น <default> handle <catalog_category_default> handle เป็นต้น Magento จะมีการไล่อ่านข้อมูล ตามที่กำหนดใน app/etc/modules/Mage_All.xml
• type – This is the identifier of the module class that defines the functionality of the block. This attribute must not be modified.
• name – This is the name by which other blocks can make reference to the block in which this attribute is assigned (see diagram 3).
• before (and) after – These are two ways to position a content block within a structural block. before=“-” and after=“-” are commands used to position the block accordingly at the very top or very bottom of a structural block.
• template - This attribute determines the template that will represent the functionality of the block in which this attribute is assigned. For instance, if this attributes is assigned ‘catalog/category/view.phtml’, the application will load the ‘app/design/frontend/template/catalog/category/view.phtml template file.
• action – <action> is used to control store-front functionalities such as loading or unloading of a JavaScript. A full list of action methods will soon become available, but in the mean time the best way to learn about the different action methods is by playing around with them in the currently available layout updates.
• as – This is the name by which a template calls the block in which this attribute is assigned. When you see the getChildHtml(‘block_name’) PHP method called from a template, it is referring to the block whose attribute ”as” is assigned the name ‘block_name’. (i.e. The method <?=$this->getChildHtml(‘header’)?> in the a skeleton template correlates to <block as=“header”> ).
Widget - คือ frontend block ที่มีการกำหนดค่าเริ่มต้นบางอย่างไว้แล้ว สามารถแก้ไขได้จาก หน้าของ admin ช่วยให้จัดการกับ theme ได้สะดวกขึ้น โดยที่ผู้ใช้ไม่ต้องรู้เรื่องเทคนิคมากนัก เช่น เจ้าของร้านค้า
ตัวอย่าง - CMS Page Link, CMS Static Block etc.
Simple Product -
Configurable Product -
Up Sell -
Cross Sell -