Jump to content

Archived

This topic is now archived and is closed to further replies.

Mark Evans

Templates / Layout

Recommended Posts

Ricght now I use STS template, it's ugly.

 

Here is what I'd do :

 

Separate all logic from presentation. Right now the code is a mess. For instance, on a typical page, instead of 1000 lines of php mixed with HTML you should get :

 

- classes to get the data (category tree, products list, cart, specials), outputting a set of normalized data structures

- classes to present the data

 

Then, one could have several generator classes (think : products generated by manufacturer, by search, by category...) and several presentation classes (1 column, 2 columns, images only...), then it's mix'n'match.

 

There are embryoes of this in the products_listing modules et al, but well.

 

Presentation classes could be smarty classes, or could be implemented in PHP.

 

Semantic HTML would be used, using CSS context properties, which gives smaller and better HTML.

 

And some means of control should allof, for instance, to not display the cartbox on the shopping cart page ;)

Share this post


Link to post
Share on other sites

One of the reasons I've decided to use OsCommerce is because it stated that templates were part of it on the features... then after searching the installed version on my website I realised that the version for templates hadn't been released yet!

 

When is MS3 going to be out with template support? I wanted it last week ;)

 

I love the idea of templates. It means that you can easily change the look of your site with out too much hinderance (oh yeah I know stylesheets do the same - but they should be used WITH templates.

 

One thing I like about any site is user interaction.... so perhaps allowing the users to choose a template they like for the site would be a good option too - a good example of this is php-nuke. Templates with nuke are easy to create and it doesn't distract from originality if you feel creative enough to make your own.

Share this post


Link to post
Share on other sites
Well a template system for osC....wow!!

 

One thing I would suggest is that the box class be dropped or totally re-written, so each box can have a unique look and be able to place the box, on the left, center, right side of the page.

 

Control and ease of implementation are key here, so that most people will have a simple control system for moving, removing, and layout looks for each box.

 

Use of box tops and bottoms should be built into the system, so both boxes and modules can have this feature available with ease of use.

 

As well, I would suggest an admin tool which will allow users to upload a complete layout and one button to install the layout, and one button to use the layout.

 

As for what should the new layout look like? well you started a thread on this already, and I really do not feel it is an important issue, when compared to the functionality of the system.

 

Last, I would look to a dynamic button selection system.  Now that the Gifs, will be available to the public without additional licencing soon (if not everywhere now).  A system which would allow you to pick which button to use could be done via a dynamic generation system, which would give more flexability and allow buttons to be created with ease.....

Just a few thoughts.....

 

cheers,

 

Peter M.

 

 

I've been doing this very thing myself. I've pretty much dessected the entire OSCommerce site and removed all tables, and replaced with CSS.

 

I've rewritten the CSS file to allow control over each box-allowing visible and inivisble boxes.

I also made catagories into lists, as well as the cart box.

 

It's still in beta but here is the link

 

http://www.grindhousedesign.com/catalog/

 

Rich


Rich

Share this post


Link to post
Share on other sites

Hi there,

 

Just wanted to add my two pennies worth.

At the moment I use the 'Simple Template System' as it allows me to design the page pretty much however I wish. I then have to admittedly change a few lines in PHP files for other certain small layout issues but on the whole I think that this way is exceptionally easy to use.

 

I think the design and the code parts of a template need to be completely taken away from one another. I am not too sure how you would do the code but I think that the way STS handles it is fantastic. Just give people simple variables that they can place into a template wherever they want and then it automatically parses in the data for them. To also allow different page designs for certain parts of the site is a must aswell. That way people could easily design a template and pop in the parts they want. This would hopefully allow more designers to create fantastic designs and be able to upload them without having bucket loads of coding knowledge but also when the design is uploaded will allow the coders to be able to change the general output of the code to change some of the layout aspects aswell.

 

So pretty much (without sounding rude!), never the twain shall meet but both can still exist together.

 

I think the idea of different templates would be great aswell. Whether or not the customer should be allowed to pick them begs to be seen as when I buy items from an online store I'm not really too bothered about changing the look anywhere as near as much as if it was a forum which I might pop into everyday.

 

I think it would be very easy to implement as all you would need is a simple 'templates_config.php' file that would have possibly a couple of variables in there :

 

1 - $path_to_skins = "catalog/my_skins";

2 - $default_skin = "mainSkin";

 

This would then make the cart look into the specified folder and use the files it finds in there.

 

Sorry for ranting on but they are just my ideas on it.

 

I very much look forward to seeing whatever is thought up and if it is anything at all like the rest of the osCommerce package then it should be absolutely amazing. Does anyone have any ideas when this will all happen? Also will mods like 'Simple Template System' still work with the Milestone 3 version of osCommerce?

 

Regards,

 

Mark Bowen

Share this post


Link to post
Share on other sites

Unfortunately, STS adds an entirely new layer of processing for every page load. What it does is parse the original output from OSC and redraws everything. This is creating everything twice and parsing large screens. While it might be used for ideas, a better system is needed for resource hungry large shops.

Share this post


Link to post
Share on other sites

I?m also using STS since it give?s you quite ab bit of flexibility.

But still I have to edit some HTML in nearly 40-50 files to really get another look into the system. (for ex. freakyphones.de / shop.dasdepot.com or mediaprojekte.de)

 

I?m using Mambo too, and i?m impressed how they solved their template-Problem in their new version 4.5.1.

They have css + layer-Tags to manage an overall layer of the design and you?ll find table tags just inside the specific modules/components.

 

I think OSC should go that direction to.

Share this post


Link to post
Share on other sites
I?m also using STS since it give?s you quite ab bit of flexibility.

But still I have to edit some HTML in nearly 40-50 files to really get another look into the system. (for ex. freakyphones.de / shop.dasdepot.com or mediaprojekte.de)

 

I?m using Mambo too, and i?m impressed how they solved their template-Problem in their new version 4.5.1.

They have css + layer-Tags to manage an overall layer of the design and you?ll find table tags just inside the specific modules/components.

 

I think OSC should go that direction to.

You didn't check the phone + projektesite in some real browsers like Mozilla or Opera, did you :(


"If you're working on something new, then you are necessarily an amateur."

Share this post


Link to post
Share on other sites

i know there are some problems... i checkt with firefox/safari(some probs here).

but that is part of the OSC problem. you really have to search a lot to find those bit?s and pieces in different locations and since i don?t get paid for those 2 projects you have to make a compromise between style and the time you spend on it.

 

I?m not to lucky about that and will check again with opera. Thanks for the hint.

Share this post


Link to post
Share on other sites
i know there are some problems... i checkt with firefox/safari(some probs here).

but that is part of the OSC problem. you really have to search a lot to find those bit?s and pieces in different locations and since i don?t get paid for those 2 projects you have to make a compromise between style and the time you spend on it.

 

I?m not to lucky about that and will check again with opera. Thanks for the hint.

osC problem?

The problems are because of the changes, a standard osCommerce shop does not have those problems. Payment has little to do with it.


"If you're working on something new, then you are necessarily an amateur."

Share this post


Link to post
Share on other sites

I vote for Smarty templates. They are very fast, simple to use and understand, powerful and extremely flexible. They even have a plugin system for adding additional template features.

 

Take a look for yourself...

http://smarty.php.net/

Share this post


Link to post
Share on other sites
osC problem?

The problems are because of the changes, a standard osCommerce shop does not have those problems. Payment has little to do with it.

 

yes right the standart does not have those prob?s. but it is boring standart, that is not really attraktive nor very flexible. That?s why we are having the diskussion in this thread.

If we would have an easy to use template strukture you could implement cool style much faster(time is money) and that would make OSC even more popular.

 

That?s what the guy?s from mambo did and they are very successfull.

Share this post


Link to post
Share on other sites

I vote no Smarty. It adds too much overhead.


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

In reality a simple system that relies on modularized file structures is much more perferable then adding in a whole new abstraction layer. The separation of the business logic is a good idea, but to take that idea and say smarty is the way to go, I would say no, and if osC ever did use it, I would think that other forks out there would be more appealing to me.

 

I am not concerned with how designers want the php out of the template layout, this is not ever going to happen. You can replace the php with some other type of tag system (ie what smarty uses), but what is the advantage of doing that?

 

PHP was designed to work on web sites, and it is plain that it is here to stay. If you want a dynamic site, then you are going to have either embedded php or some type of tag which is parsed into a php function/logic. Why do this at all? That is just one more step.

 

A good template system in my opinion leaves a small footprint in parsing, is easy to implement changes with, and separates the business logic from the displaying logic. Notice that the display has logic, and this is what is needed, you can not have dynamics without logics to control it.

 

There is no need to use smarty, or any other external solution, since there are many ideas already here which would deal with the prime concerns listed above.

 

cheers,

 

Peter M.


Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Share this post


Link to post
Share on other sites

My personal preference is a class method of the BTS system (from its early days).

 

The fundatmental point of it being something like:

 

 require( $page->template() )

 

Then as like BTS, this calls the mainpage.tpl

 

Within which:

 

<?php if($page->templateType() == 'string') { echo $page->content; } else { include($page->contentFile); } ?>

 

The preference here for me atleast, is that since it is pure php, no placeholders etc.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites
My personal preference is a class method of the BTS system (from its early days).
I agree with the classes, and parts of the BTS system. I see no need to define the BTS as it is done now in the filename defines. This idea of using the tpl.php extension just adds in additional logic executions which are not needed. Just as easy to name it the exact same as the page, and then call the page layout and classes in using a page_name variable.

 

As for the classes, I think putting much of the various php logics into a class would be much better, then calling in the pieces would enable the designer to move them easier. Classes also have the ability to separate the logic easier. And then calling in the required parts is as straight forward as what devosc laid out.

 

I also like how the install is done with the layout system, and add in a mix of classes and folders defining various parts would be a good mix. :D

 

cheers,

 

Peter M.


Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Share this post


Link to post
Share on other sites

cannuck1964, if the output was valid XHTML without any tables for layout layout then there would be no issue.

 

I'm current having to step though functions like tableBox to try and create some slightly valid markup so I can actually use CSS to build something that not your bog standard OSc installation.

Share this post


Link to post
Share on other sites

vaild XHTML and a template system are two separate and different issues. Any template system can have valid XHTML, and having standard XHTML does not imply you have a template system. Yes, I agree the output from the standord osC should comply with standards, but that has nothing to do with a template system.

 

I disagree with having the entire system rely on css for the template system, this limits the system too much, rather a template system which uses css and complies with standards, while retaining the ability to use other methods is more functional and what people are looking for.....

 

cheers,

 

Peter M.


Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Share this post


Link to post
Share on other sites

:rolleyes: I think this is great!! How can I get this new feature.

 

As you might of seen from the current CVS we are introducing the concept of templates into the osCommerce administration tool.

 

These templates will also be integrated into the catalog area.

 

Please post any features / suggestions you have for the templates and general layout of osCommerce in this thread.

 

There will only be a single supported template engine for osCommerce. Any other template engines that are contributed will not be supported so please make sure you post your suggestions here to get the features added.

 

Any posts not related to the templates / layout are likely to be removed.

Share this post


Link to post
Share on other sites

This is a really great article. I like Smarty, but it is probably too much overhead, and too controversial for the oscommerce community. A simpler strategy that removed the presentation logic from the business logic would be fantastic. The important point, I think, is to separate the HTML and presentation (with minimal logic, php-type code) into separate files that designers can work on. Keeping it simple as possible, with as little overhead as possible, seems the way to go. But the current style, with the heavy intermixing of PHP logic with HTML, should be cleaned up.


Thanks,

 

David Watson

Share this post


Link to post
Share on other sites

I don't know if someone already menssioned this, as I was not following the topic but,I would suggest changing the category links on the left into buttons instead of text.The default color is also bad. The "color against background" evaluation criteria needs to be looked at. Thank you for you're kindness and doing something like this. Just think if all programers did this...Cyber OS! lol

Share this post


Link to post
Share on other sites

×