欢迎来到天天文库
浏览记录
ID:40559642
大小:82.00 KB
页数:9页
时间:2019-08-04
《magento布局介绍IntrotoLayouts》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、布局介绍IntrotoLayouts星期二,08/19/2008-22:22—foolsky布局介绍Layouts布局Layout,就像它的的组件一样,很容易误导你以为要用好它就要先学习好编程逻辑。事实上,布局只是一些XML标签组成的。它很容易学习。学习一些关于布局的基本概念和命令之后,你会很自信的按你的意愿修改和设计你自己的网店布局·布局是如何工作的HowLayoutWorks·解剖布局AnatomyofLayout·XML规则RulesofXML·入门联系QuickExercisestoGetYouS
2、tarted 布局是如何工作的HowLayoutWorksLayout布局是magento应用的一些虚拟组件。你可以通过修改这些布局组件来达到建设网店页面的目的。Diagram1 布局包含默认布局defaultlayout和升级布局layoutupdates两种,他们都是由很容易学习的XML标签构成的。通过这些布局命令,你可以修改/分配内容区块,结构区块的关系,也可以控制网店前台的功能性。比如加载或者卸载特定的区块JAVASCRIPTS到一个特定页面。布局文件是基于每个模块单独存放的。每个模块都有自己的布
3、局文件。(比如'catalog.xml'是catalogmodule的布局文件,...etc).这些布局文件位于app/design/frontend/your_interface/your_theme/layout/andeachfileisfurtherseparatedbyhandles(seediagram1),eachhandle(withtheexceptionof)assigningitsnestedupdatestotheaccordingspecificpageinth
4、estore.Somelayoutfilesmaycontainthehandle.Whenparsingthelayoutfiles,Magentofirstgrabsthelayoutupdatesassignedinthehandleofalmostalllayoutfiles,readingthemintheorderasassignedinapp/etc/modules/Mage_All.xml.Itthenparsesthepage-specificlayo
5、utupdate,finalizingthebuildingofastorepage.Thesystemisbuiltthiswayinordertoallowseamlessadditionandremovalofmoduleswithouteffectingothermodulesinthesystem.BacktoTopAnatomyofLayoutLayoutcontainasmallsetofXMLtagsthatactasdetailedinstructionstotheapplication
6、onhowtobuildapage,whattobuilditwithandthebehaviorofeachbuildingblock.Thebestwaytoapproachlayoutistojustdiverightinandattackitfromallangles.Inorderforyoutodothat,here’resomebehavioralpropertiesofeachlayoutXMLtag.HandleHandle(diagram1)isanidentifierbywhicht
7、heapplicationdetermineswhattodowiththeupdatesnestedbyit.Ifthenameofthehandleis,thentheapplicationknowsthatitsnestedupdatesmustbeloadedonalmostallthepagesofthestorepriortoloadingpage-specificlayout(Wesay'almostall',becausesomeexceptionalpagesliket
8、heproductimagepopupdoesnotloadthelayoutinthehandle).IfMagentofindshandlesotherthan,itwillassigntheupdatesnestedinsidethehandletotheaccordingpagespecifiedbythehandle.Forinstance,
此文档下载收益归作者所有