Call-back icon  Enterprise Sales: +1.310.775.2674 (N. America)   +44 20.3286.4137 (UK)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 1 of 3
Tutorial for integrating my css/xhtml template? 
 
stevefink
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-10-26
Philadelphia, PA
 

Hi all,

I’m at the point of frustration with competing ecommerce solutions that I really don’t care if Magento is in a pre-release stage. I’m going to go for it anyway as I have full confidence in this software engineering team.  I’m going to be launching a store (hopefully!), with a shopping cart of exotic/custom designed jewelry. My father is the designer. I’m just the web geek. I’m extremely excited to start interacting with the community here!

With that said, I’ve tried surfing the wiki/knowledge base on how to begin integration my existing css/xhtml template the proper way. I’m looking to bring in the following to Magento:

http://gregs.phpgeek.org and http://gregs.phpgeek.org/subpage.html

I’ve found the CMS management section on the admin side, but it doesn’t seem this is the tool I’m actively seeking.

Thank you for pointing me in the right direction.

Cheers,

- sf

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

This is a good start - http://www.magentocommerce.com/wiki/how-to/designing/designing-for-magento

We are currently working on documentation. If you run into any questions please post them on the HTML, XHTML, CSS, Design Questions Forum

Thanks!

 Signature 

Roy Rubin
Magento Team

 
Magento Community Magento Community
Magento Community
Magento Community
 
stevefink
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-10-26
Philadelphia, PA
 

Thank you for the reply Roy!

I’ll get to work on this tomorrow and post results as soon as I have something credible. grin

Cheers,

- sf

 
Magento Community Magento Community
Magento Community
Magento Community
 
stevefink
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-10-26
Philadelphia, PA
 

Hey folks -

So admittingly, the templating is a bit overwhelming at first. Especially when I have everything pieced together already in valid XHTML/CSS. 

Would anyone with more experience be kind enough to steer me in the right direction? I guess my layout includes a header, a left column, and a content window as you can see in http://gregs.phpgeek.org.  Should I start breaking this thing up into several different xml/phtml files? I’m an avid user of web technologies including XHTML/CSS/PHP/XML/JavaScript, except the way things are broke down here aren’t my ‘norm’ way of working.

I’d definitely appreciate it if someone can give me some advice.

Thanks all, hope I can get this to eventually work with my store.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ohminu
Magento Team
 
Avatar
Total Posts:  173
Joined:  2007-08-07
Portland, OR
 

Hi there stevefink,

Let’s take it step by step.

1. Layout your Structural Blocks (aka Determine your page layouts)
When you begin the implementation process, first ask yourself this question: What are the layout needs of my store?
What this simply means is: “Will my store always have a left column? Or will some pages have a left, main and a right column? Or perhaps some of the pages will just one column?”. These questions are imperative because the variations of page structure will directly determine the number of skeleton templates you will need to create - For instance, if you have a one column and a 3 column layout, you will need to create two skeleton template accordingly. But before we go further, let’s first look at what a skeleton template looks like.

<html>
<
head></head>
<
body>
<
div class="header"><?=$this->getChildHtml('header')?></div>
<
div class="middle">
    <
div class="col-left"><?=$this->getChildHtml('left')?></div>
    <
div class="col-main"><?=$this->getChildHtml('content')?></div>
</
div>
<
div class="footer"><?=$this->getChildHtml('footer')?></div>
</
body>>
</
html>

Pretty straight forward. This type of templates are what we call “skeleton templates” because it exists for the purpose of positioning structural blocks within a page. Such templates are located in app/design/frontend/default/default/template/page/, and you can name it anything you want - mycolumns.phtml, 2columns-left.phtml, whatever suits your fancy. “Wait a minute!!! What is all this <?=$this->getChildHtml('')?> business?” you say. Ok, let’s move along.

If you examine the method <?=$this->getChildHtml('header')?>, you will see that there’s an identifier called “header” being assigned to the area encased by the XHTML <div class="header">. What getChildHtml does, is it grabs all the content blocks(see step 2 below) that is assigned to “header” via something called a layout (see step 3 below), and places it inside <div class="header"></div>

2. Distribute your Content Blocks (aka Let’s cut up some real meat of the page)
Content blocks are the ones that actually parse your store’s data into visually appealing format using XHTML. Unlike other eCommerce solutions you may be used to, Magento supplies separate content blocks per separate functionalities. What this means is, your col_left.tpl (or whatever else you may be used to working with), no longer contains ALL the XHTML to be shown in the left column but rather, the functionality used in the left column will recruit its own template for use. Let’s take the demo Magento as an example. If you open a category page on your browser, you will see in the right column the following functionalities: mini-cart, compare products, newsletter and community poll. Each of these content blocks comes with its own template file. Because mini-cart is a separate functionality, as is the compare products, newsletter...etc, mini-cart has it’s own template file, compare products has its own template file, and newsletter has its own template file. The XHTMLyou create should be cut up accordingly on per functionality basis.

3. Let’s recap and comprehend
In this step, let’s take a breather and do a quick recap.
When working in the visual aspect of a store running on Magento, there’re three things you will use to visually parse your store data.

Structural Blocks
Structural blocks are the visual skeleton of a store page. These blocks exist for the sole reason of creating visual structure. Example structural blocks are header, left column, main column, footer...etc.

Content Blocks
Content blocks are the blocks that constructs the makeup of a structural block. Each content block represents distinct functionalities such as Mini-cart, mini-wishlist, compare products, newsletter signup...etc, and they comes with it’s own template.

Layouts
Located in app/design/frontend/your_package/your_theme/layout, layout is the one that puts all the pieces together. When a page loads in your store, the following things happen:
a. The layout first grabs the base skeleton template of the site.
b. It grabs all the content blocks that are assigned to the structural blocks of a page, and loads them.
Basically the layout says “Grab these content blocks and nest them inside these structural blocks.” The layout can be updated on a per page basis, so you can conveniently change the functionalities being loaded into each page of you store with just one file.

This is the absolute quick idea of how the templates work in Magento. We’re working on a full documentation and it will be released with the stable version of Magento. In the mean time, the best thing to do is read through the threads of the forum, stay active in the community and ask a lot of questions! I hope this reply gave you some understanding of how things work in Magento.

Cheers smile
Minu

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  322
Joined:  2007-10-01
Bakersfield, CA
 

That clears a lot of things up for me.  I’ve been trying to wrap my head around how Magento’s templating system works, and that explanation makes it very easy to grasp.  I can’t wait for final documentation so I can really get into the details.  Thanks!

P.S. Raise your hand if you think Minu deserves a big raise. *raises hand* wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
ohminu
Magento Team
 
Avatar
Total Posts:  173
Joined:  2007-08-07
Portland, OR
 

Excellent, i96!. It’s important that these help posts come through to you guys. Keep your feedbacks coming smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
xdeveloper
Jr. Member
 
Total Posts:  4
Joined:  2007-11-12
 

*raises hand* Thanks, Minu. Thanks to your post I was able to understand within a few minutes what I’ve been trying to figure out for the past two hours! I also look forward to the final templating documentation. keep up the good work!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Loquix
Jr. Member
 
Total Posts:  1
Joined:  2007-11-10
 

Hi Minu
What sort of development times do you expect when customising the templates?

For example a two person team working 7 hours a day.
To re-dress Magento with a whole new look and feel: 2 weeks or 3 months?

cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
stevefink
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-10-26
Philadelphia, PA
 

Minu, I *completely* am greatful for the post you’ve made above. You went above and beyond what most people would in many communities. You really are a valuable key player and I’m looking forward to reading that with my breakfast to see what I can apply to my existing template. I’m like, dying to get this thing working.  Cheers!  - sf

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tonyo
Jr. Member
 
Total Posts:  10
Joined:  2007-10-24
Conwy N.Wales
 

Hi Minu

This is an excellent post. Well done for that.
We need to put this in the Wiki or some place we can refer to it.
Keep up the good work.

regards Tony

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Sr. Member
 
Avatar
Total Posts:  273
Joined:  2007-09-10
Orange County, CA
 

Hi Minu,

That was definitely a great write-up that helps explain things much clearer.  Thank you!

Brady

 
Magento Community Magento Community
Magento Community
Magento Community
 
iblastoff
Sr. Member
 
Total Posts:  253
Joined:  2007-08-31
 

thanks minu!

 Signature 

stevelam.ca | xpattern.net

 
Magento Community Magento Community
Magento Community
Magento Community
 
ohminu
Magento Team
 
Avatar
Total Posts:  173
Joined:  2007-08-07
Portland, OR
 

Hello Loquix smile

Your question is understandable, but a hard one to answer. There’re many things to consider when budgeting the time.

1. How versed are you with Magento?
A thorough documentation for Magento is yet to be released and that means you will not have a full list of available template tags at your disposal until such time. Time to consider would include your research stage both through your own searching/figuring in files, as well as assistance from other community members in regards to available tags, as well as the general learning curve of how Magento operates and what is available to use. I’d think this will pass some time…

2. How versed are you with XHTML/CSS?
Pretty straight forward...How good are you with XHTML and CSS?

I think it’s just like learning any other system of things, Magento has its learning curves (especially because it’s done in such a eh hem...REVOLUTIONARY way), albeit it’s no brain surgery. I’m sorry Loquix, I don’t have a straight forward answer for you ... everyone and every situation’s different.

 
Magento Community Magento Community
Magento Community
Magento Community
 
whidbey
Jr. Member
 
Total Posts:  20
Joined:  2008-03-26
 

thx minu:)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yosuke
Jr. Member
 
Total Posts:  3
Joined:  2008-08-23
 

Minu,

Your posting was absolutely great, very simple and straight forward explanation. I am one of the business owners and web developers who is trying to implement Magento to my business. I have been looking screenshots and this form to find out how I can complete my website. Your post really helps me to understand the key component of template. Than you, thank you very much, Minu!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3
 
© Copyright 2009 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
108729 users|467 users currently online|199815 forum posts