Magento Forum

   
Page 2 of 3
Template System
 
Johan
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2007-09-01
Sweden
 

It’s definately back to school for me. I know both XHTML and CSS very well. However never used Zend and true XML to template anything.

A full documentation on how to skin using this framework is much appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

Johan, we are already working on that documentation. An outline of what we plan to write is here:

http://www.magentocommerce.com/wiki/Designing-for-Magento/

Stay tuned to that article for more information!

 
Magento Community Magento Community
Magento Community
Magento Community
 
RoyRubin
Magento Team
 
Avatar
Total Posts:  968
Joined:  2007-08-07
Los Angeles, CA
 

Scott - I added the CSS Resources list to the Wiki

http://www.magentocommerce.com/wiki/CSS-Resources/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

Good thinking. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
gamelodge
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2007-08-31
Brisbane, Qld, Australia
 

Hi Scott

That documentation is great thank you for it.

I was wondering if you had more of a conceptual overview of what magento is trying to achive with its templating.
for example, in the features list under design packages they mention “Layouts: Define the structure and arrangement of the building blocks of the site. (e.g. 2 column vs 3 column layout, location of mini shopping cart block, etc)”

could a developer expand on this ie

what defines a block?.. are there certain limitations, where should a block be defined in xml or as phtml etc..
what is the role of xml with regards to layout, and how does layout differ from template, an example is the “layout type” files in the template/page directory,
how does the block nesting work, how deep can we go

how is it all stiched to toghether ie when a page is viewed what happens first, is it global layout called then page layout, then blocks? what takes preference etc etc..

forgive me if this is standard Zend templating as i am new to Zend Framework, if its all standard stuff i should know please point me in the right direction.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

One of our main goals in Magento is to provide the maximum flexibility possible for all layers of users and developers that will be working with Magento.

The requirements of having updates possible without breaking existing cutomizations, and being able to create any kind of design and layout, made as come up with a way to create a glue layer between code and templates, which we call layouts.

Layout definitions are XML structures that can be stored as text in files or database. We call them layout updates.
These updates are called on specific events during the application flow.

The most prominent layout update is the “default” one, which is located in “core/default.xml”. This layout is invoked for almost all the pages on the store.

You may find that there are “initLayout.xml” files located in other module folders. These are updating the original “default” layout, specifically for each module.
For example, checkout/initLayout.xml does adds checkout links on top and adds sidebar mini cart on the right column.

Other layout update files are invoked at specific events, like “checkout/cart.xml” is used on the shopping cart page. It does:
- set 1 column layout.
- add shopping cart view block, set template file for it
- add coupon, shipping, cross-sell blocks and set template files for them.

Modules that will be installed later and aware of checkout module will be able to update these layouts WITHOUT changing existing code or layout files, just by adding their own layout updates.

Right now layout updates can create new blocks and perform methods on existing blocks.

We do have future plans to have GUI editor in admin area for layout updates.

Blocks are logical units, and their ultimate goal is to produce a final output, which can be HTML, JS, JSON, XML, or anything else.

Blocks can be nested as far as PHP function nesting configuration permits.

Blocks that extend “core/template” will use templates to generate output.
Other blocks will generate output directly from PHP, unless they employ custom logic involving templates.

You do not HAVE to use layouts to create a store design.
In fact you can create a store with one layout, that contains only root block, and one template file that will include all the child block creation logic.
Although I highly do not recommend this solution.

And no, this is not a standard Zend templating smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

I am not sure I was able to convey all the power and potential of this approach, when the documentation and more package/theme examples will be ready, it will be much more clear =]

 
Magento Community Magento Community
Magento Community
Magento Community
 
Solar Frenzy
Member
 
Avatar
Total Posts:  48
Joined:  2007-09-05
London
 

One main feature that turned me to Magento is the use of XHTML and CSS, they are my prime tools of design/developement.
Currently I am using oscommerce and although it’s a great tool I have to manually convert a shed load of tables to css.

If you need anymore CSS links, I have a ton here:
http://thedesignerforum.com/digidump.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
lkbryant
Member
 
Avatar
Total Posts:  60
Joined:  2007-09-03
 

from the looks of it, i think Magento uses a very unique (if not strange) design system it takes some time getting used to.

i think i got some hang of it but still, it’s alot of work to convert any design i have to magento!

 
Magento Community Magento Community
Magento Community
Magento Community
 
RoyRubin
Magento Team
 
Avatar
Total Posts:  968
Joined:  2007-08-07
Los Angeles, CA
 

lakers - Magento offers complete flexibility when it comes down to layout for every single page on the store. This may be a hard concept to grasp, but the options are limitless. And yes - there is a learning curve - once the documentation will be available things will be much easier to digest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
austinstorm
Member
 
Avatar
Total Posts:  31
Joined:  2007-08-31
Moscow, ID
 

I know that you folks at Varien do eCommerce sites, so I’m sure you made it easy to customize. I cannot wait to learn how it works so that I can get my hands dirty!

 
Magento Community Magento Community
Magento Community
Magento Community
 
gamelodge
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2007-08-31
Brisbane, Qld, Australia
 

Hi Moshe/Roy

Should we wiki that reply from moshe?
maybe add it as an intro to the

http://www.magentocommerce.com/wiki/Designing-for-Magento/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mason
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2007-09-09
Michigan
 

The wiki for Magento’s templating system is going to require some major refinement. While the knowledge is present, it isn’t being articulated in a fashion that even someone with an extensive XHTML and CSS background can gracefully digest. If no one objects, maybe I can play grammar police and go through with my billy club wacking those sentences into shape?

Also, what level of proficiency with web development practices is Magento intended for? As previously mentioned, I have experience with XHTML and CSS but I see that Magento relies heavily on XML for its templating system. How intimate an understanding of XML is required to port a design from XHTML/CSS to Magento?

Thanks,
Mason

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Wiki is an open system, so if you feel that you can contribute in informational or grammatical sense, you are welcome to update it smile

As of XML understanding, it depends what level of customization you intend to introduce to existing packages.

New functionality most probably will require knowledge of PHP and OOP patterns.
Changing locations of module blocks will need understanding of Magento XML layout structure.
Updating XHTML/CSS skins will naturally require knowledge of XHTML and CSS.

To answer your question I will need you to give an example of customization you wish to introduce.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

The Wiki for design is still a work in progress and of course you are able to edit it as you see fit. In the coming weeks I am also planning on providing a few screencasts that should take you through the design features in a more articulate and time-conscious manner.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 3