Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento Template System
 
jrochman
Jr. Member
 
Total Posts:  24
Joined:  2007-09-05
 

I have began to to play around with a local installation.  Although, they system is extremely flexible, it has come at the cost of the template system being convoluted and overly complicated.  Just as one member posted, this is evident from all the templates used in the “Showoff” forum, which are just slight modifications of the original template.

I understand that there probably has been a lot of coding done into the way that the system is currently templated, but being as early into the stages of development, I do not see why others methods can not still be considered.

I strongly urge the developers to download a copy of MODxCMS at http://www.modxcms.com and look at its take on templating.  To create a template, you can just take any (X)HTML/CSS design, paste it in, and then replace some of the content with placeholders, and php calls that allow further templating of its output. 

Essentially, to output a site like http://www.blueskyvineyard.com, the template looks like so:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<
html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

  <
head>
    <
base href="[(site_url)]" />
    <
link rel="stylesheet" type="text/css" media="screen,projection" href=
    
"assets/templates/multiflex2/css/style_screen.css" />
    <
link rel="shortcut icon" type="image/x-icon" href="assets/templates/multiflex2/img/favicon.ico" />
    <
title>
      
[(site_name)&ampWinery in Southern IllinoisPremier Illinois Wine
    
</title>
<
meta name="verify-v1" content="ATw1bzO1Rpf7JyT7u9W+7DDYpYXwrwVJjiganc7B5+0=" />
  </
head>
  <
body>
    <
div class="page-container-1">
      <!-- 
HEADER -->
      <!-- 
Navigation Level 1 -->
        <
div class="nav1">
          
[[Wayfinder? &startId;=`6`]]  <!-- This dynamically generates menus.  The default template is used for its output -->
        </
div>
      <!-- 
Header banner -->
      <
div>
        <
img class="img-header" src=
        
"assets/templates/multiflex2/img/header.jpg" alt="" />
      </
div>
      <!-- 
Navigation Level 2 -->
      <
div class="nav2">
 <!--  
This outputs a dynamic menu with a template defined in a document I call "hereTpl" -->
        
[[Wayfinder? &level;=`1` &startId;=`0` &hereClass;=`selected` &hereTpl;=`hereTpl`]] 
      
</div>
      <!-- 
Buffer after header -->
      <
div class="buffer">
        <
div class="breadcrumbs">
 <!--  
Outputs breadcrumbsthe default template was acceptable    -->
          
[!Breadcrumbs-Modified? &crumbSeparator;=``!]
        
</div>
        <
div class="searchform">
 <!--  
Outputs search boxajax capable if wantedthe templates default template acceptablebut every part of it is micro templateable -->
          
[!AjaxSearch? &ajaxSearch;=`0` &AS;_landing=`9`&extract;=`1` &showMoreResults;=`1` &extract;=`0`&AS;_showResults=`0`!]
        
</div>
      </
div>
      <!-- 
NAVIGATION --><!-- Navigation Level 3 -->
      <
div class="nav3">
      <!-- 
Placeholder for any content I wantit houses another menu generating php codethat might need to be changed on a per page basis.   -->
        
[*sideNavigation*<img src="[*leftBottle*]" alt=
        
"[*leftBottleDesc*]" />
      </
div>
      <!--    
CONTENT -->
      <
div class="content1">
        <!-- 
Page title -->
        <
h1>
 <!--  
Placeholder for pages long title   -->
          
[*longtitle*]
        
</h1>
        <!-- 
Text container -->
         <!--  
Placeholder for pages content   -->
            
[*content*]

        
<!-- Text container -->
        
          <
div class="col-left">
            <
h2>
              
Suites
            
</h2>
            <
h3>
              
Where luxury &ampcomfort meet.
            </
h3>
              <
p>
                
[*suites*]
              
</p>
          </
div>
          <
div class="col-right">
            <
h2>
              
Weddings &ampEvents
            
</h2>
            <
h3>
              
BeautifulTranquilInspiring.
            </
h3>
              <
p>

 <!-- 
More placeholders  -->

                
[*weddingsEvents*]
              
</p>
             
          </
div>
          <
hr />

 <!--  
Another placeholder for contentthe "#" means that it can edited on the frontendon the fly.  -->
 
[*#bottomContent*]
      
</div>
      <!-- 
SIDEBAR -->
      <
div class="sidebar">
        <!-- 
Main Title -->
        <
h1>
 <!--  
Pulls in any XML feed and allows every elemet to be templated with placeholders   -->
          
Weather
        
</h1>[!FeedX?&url;=`URL_REMOVED`;preset=`weather.com`!]
        
<!-- Textbox -->
        <
h1>
          
What's New
        </h1>
        <ul class="indent">
          [[Ditto? &parents;=`58,13` &display;=`4` &total;=`4` &tpl;=`ditto_news` &paginate;=`0` &extenders;=`summary`]]
        </ul>
<!-- Textbox -->
        <h1>
          Wine of the Month
        </h1>
        {{wineOfTheMonth}}
<!-- Textbox -->
        <h1>
          Events at a Glance
        </h1>
<h2>Festivals</h2>
<p>[[Ditto? &parents;=`61` &sortBy;=`eventDate` &sortDir;=`ASC` &display;=`4` &total;=`4` &tpl;=`ditto_event_sidebar` &filter;=`eventDate,@EVAL return time();,3`]]</p>
<h2>Sundays in the Park</h2> [!FeedX?&url;=`URL_REMOVED`&;preset=`gcal`!]<!-- Textbox -->
        <h1>
          Hours of Operation
        </h1>{{hours}}
      </div>{{footer}}
    </div>
  </body>
</html>

I would just like to hear the developers thoughts after trying out the system to explain the advantages/disadvantages to there system compared to the one MODx uses, which in my mind is the best match of flexib

 
Magento Community Magento Community
Magento Community
Magento Community
 
mds
Jr. Member
 
Total Posts:  27
Joined:  2007-10-04
Raleigh, NC
 

Let’s give the Magento developers a chance before telling them to completely change their template system!  I think it’s far too early to look at other people’s templates in the showoff section and say they “are just slight modifications of the original template”.  Any decent template or modification would take some more time...or maybe people are waiting until a non-beta version is released before creating a full blown one-of-a-kind masterpiece.

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

I will try to give answers, but please correct me if i’m not answering the right questions, because i’m not sure what are the questions here, because MODx is CMS solution and Magento is an e-commerce solution, each one has different goals and requirements.

If you mean to compare straight PHP templating versus 3rd party syntax templating, then here are the reasons we have chosen straight PHP:
Straight PHP does not need extra parsing layer for performance reasons and has incomparable flexibility over 3rd party syntax templating.
Besides, learning [(site_name)] [[Wayfinder? &startId;=`6`]] {{footer}} [*#bottomContent*] [*suites*] gives knowledge of this specific proprietary templating system.
If you are PHP developer, knowing PHP template doesn’t require any additional learning; maybe only a reference of API, as with any application, including 3rd party templating systems.
If you are not PHP developer, learning PHP template will contribute towards your further development of PHP skills.

If XML layer is the concern - i’m sure that with the time there will be a design package created using only templates. Of course when drag ‘n drop interface for editing layouts will be made, this package won’t benefit from it.

In general, XML layouts were created with developers in mind, which will create basic packages and let HTML designers do the themes, as it is done now in CMS world.
You can see different packages/layouts as different storefronts, which you apply themes (templates and skins) to.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bernhard Huber
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2007-10-03
Warsaw Poland
 

I understand the Issue, a enduser wants not go through layout/themes, he wants easy understanding

But, what he should want and gets with magento is :

the possibility to manage different sites with just one core
easy upgrades even if he has a lot of own design ( speaking about templating system, not yet taken a look into the rest wink )

I suppose, it would be possible to make a user interface for easy customisation (I want to change the footer ?  an admin UI creates the phtml file for me) but this is just an additionnal layer, the core is what’s important here.

and we want to create an ecommerce site, not a blog used by millions of people

but, and this is a business idea, it would probably be possible by creating this template interface, to make a neat all-in-one hosted shops solutions powered by magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

If you want an example of what’s possible check out the site in this thread and the files I’ve posted with it http://www.magentocommerce.com/boards/viewthread/837/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Redman
Jr. Member
 
Total Posts:  6
Joined:  2007-10-06
 

Smarty or Pat Template.....

Both work great, Pat template is the fastest to build on. Mambo use it and it rocks....
Smarty (uses short code) requires a language file (to parse the short code)

Both are excellent, but Pat template is the fastest to develop with and has minimal server overhead.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top