Jump to content

Archived

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

Mark Evans

Templates / Layout

Recommended Posts

As a total beginner I'd like to see a bo I can fill with HTML to sit on my front page within the framework of the php - I can edit that it dreamweaver and not struggle so much to make my pages look right first time!

 

I'm happy to add more complex features later - for now I'd just like to get operational!


Confused!!!

Share this post


Link to post
Share on other sites

Hi, the template feature is a nice idea. I was actually going to make a topic about just that, and that I'm currently trying to implement a template system into oscommerce right now, but now it seems like I don't have to. Anyway, I've made a custom template system, consisting of one function and a global variable. I've pasted it below:

<?php
/**
* Template variable arrays
*
* @global array @GLOBALS['tpl']
*/
$GLOBALS['tpl'] = array();

/**
* Displays templates
*
* @param   string  $tpl_name   name of template file without the suffix
* ".tpl"
* @return  TRUE|FALSE
*/
function sms_tpl_show ($tpl_name)
{
$tpl_file = SMS_TEMPLATE_DIR . '/' . basename($tpl_name,'.tpl') . '.tpl';
if (FALSE != file_exists($tpl_file) && FALSE != is_readable($tpl_file))
{
	@include_once SMS_TEMPLATE_CONFIG;
	@include_once $tpl_file . '.inc';
	extract($GLOBALS['tpl'],EXTR_OVERWRITE);
	include $tpl_file;
}
else {
	// Log error
}
}
?>

 

I suggest you use something like this, and not a system like smarty, because it's not nessecery to define a "new" language with php, php does what you want. As you see, it works a bit like smarty, in the way that you assign template variables to a special variable. That master variable then gets extracted, in the template function that also includes the master config file and a document specifict if any and then the template file. The template file will then have the variables assigned in their "global" space. A sample template file might look like this:

<?php require 'header.tpl'; ?>
<div id="content">
<h2><?php echo $page['title']; ?></h2>
<?php foreach($page['paragraph'] as $p) { ?>
<p><?php echo $p; ?></p>
<?php } ?>
</div>
<?php require 'footer.tpl'; ?>

 

I also have the template section use ob_start() and output everything with one echo, that also can get filtered(e.g. you can highlight searched words). I also think it would be a good idea using the phpDocs commenting style. It would make it easier to modify the project and it would provide real documentation on every asspect of the source. Anyway, could someone please tell me where I can download the cvs version? I've looked in the download area, but I haven't found any cvs information.

Share this post


Link to post
Share on other sites
I have a varied background - originally a designer, then moved into information architecture. I recommend the use of templates for standardizing site elements - this simplifies navigation and use for the customer. Which in turn results in increased sales. Good design principles should be applied to all aspects of the site, but in my mind it makes sense to create standards for your site which remain constant. That can also help you reinforce your brand. All of this is subjective; the above is just my opinion.

I think the idea of having templates is to have the ability to include custom templates as long as they follow some type of standard. standards are essential for the success of any technical (or non-tech for that matter) project especially a software project.

Share this post


Link to post
Share on other sites

For the templates issue, maybe something could be used like what PHPNuke and other Nuke CMS do?


Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Share this post


Link to post
Share on other sites

I have a suggestion for the catagories and subcategories. It is very uncomfortable for me to say, the current design is kinda awkardward for normal user to use. Since category and subcategory are like the folders, I think for my users they prefer to see NO pictures for Subcategories but stay on once they click on it and stay visible evne when they click on other category to see other subcategory. User sometimes wants to match things up from different categories such as match shirt with pants. Subcategory is an abstract concept for a group items, they don't have a specific physical picture to represent them. The explanation should not be on this level and can be somewhere else on the help menu or whatever is more reasonable place instead of display every single pictures of the subcategory, everyone knows what is a shoe look like.

 

Please help me to make this suggestion happen in the current downloads or how to modify the code.

 

Thank,

TY

 

 

 

 

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

Hi friends,

 

I am very new toosc and I really don't have a clue what your development strategies are, BUT I have several proposals for next generation:

- add description and template fields to categories and sub catgeories

- display categories with using the specific (selected) template and show category name, description etc in the top part of main.

- do not add to much overhead, like smarty, html editors nor lots of graphics (most users are not developers, but users; this means once you have your shop up running, you don't change it every 5 weeks; you maybe change it every 3-4 years; same interval as used for redesigning a real store!!)

- a SIMPLE multilingual cms being part of the store front would be great. this would allow users to skip all intro sites and coding.

- prepare some oder processing, order handling interface php-script for connecting osc with external erp systems

 

In my opinion it is better to have a loaded sql db with lots of options to add/remove categories/product paramters than having a overloaded code.

 

First I tried an osc fork, it hade better functionallity but a far to overloaded code. Then I "returned" to osc, made a mod of osc 2.2 and connected it with a modified osssuite 1.2; oserp section and it work great! I removed as much "scrap" code as I dared (it still works!).

 

Thanks! :o

 

PS I assume I will have other interesting projects in my life when you release the osc 3.0!? DS

 

Regards, Stefan

Share this post


Link to post
Share on other sites

I second the above!

 

But as far as templates go -

What would be the most useful (and could be a lot of fun in use also), would be a sort of Template Creator as a partner program packaged along with osCommerce - wherein you could create your own template design(s), and then integrate those with osCommerce.

 

That would be the ultimate in cool. No matter how great a particular template is, everyone's site serves totally different needs. It is impossible to serve all without a template creator tool. And man, how much fun would that be??? More fun than a video game!! One could change their entire site such by creating a new template and then switching over into it. If all that were required to use it, was to learn css or the specifics of the tool, (and no php code ever having to be monkeyed with for anything regarding design and layout), sites would become more and more interesting and unique, and then the buzz would be unstoppable.

 

Sure CREloaded versions sort of already work in a template way - if you are able to create a template and integrate it by hand. What we need is a way to separate the look/feel template for the designing portion, then merge the whole thing like magic! Is it impossible? Like how csszengarden works (amazing that one document can change everything so dramatically, it's brilliant!) - apply that sort of concept in a user-friendly format. Wow!!

 

(Does a contribution similar to this concept exist for current osCommerce...? Haven't found one yet so I think this is still untraveled territory)

 

Conquer this, and yahoo and Miva and zencart will get knocked onto their poor little bums as everyone leaves to build sites in oscommerce with the most freedom of self-design that's available anywhere.

 

Good luck with the project!

 

 

 

:thumbsup:


Beautiful design is everything...the rest is just details!!

Share this post


Link to post
Share on other sites

Howdy Folks,

 

Cappy here:

 

Im sitting here looking at osc for the first time.

PHP is somewhat a mystery to me though i can look at it and eventually figure some little things out.

 

I am involved in 2 businesses that do not (could not) sell items on the internet.

(in other words no-ones going to check out or use the shopping cart or process a credit card)

 

However the store it self seems to be wonderful tool for the purpose of displaying many items so customers can browse to get an idea of what we offer or what they may want or even in their price range. (besides Its way more classy than just using a gallery tool of some kind)

also they can see such things as prices or whats new or do a search by name or manufacture ETC.

 

I would Gladly Pay/Donate for the 2 following items:

 

1. A button in the admin panel to turn off all traces of a cart, checking out, or credit card processing. (not Price stuff)

 

I expect #2 is kinda tough because of the way it looks like php inter- realates

 

2. A Get what you see kind of php editor. Something that would support images, text/font, flash files, sound and movie files that kind of thing.

The way someone might use "front page" to edit htm/html pages. (sorry front page is an easy example)

Please......... something user friendly and made just for php aplications not an all in one like macromedia 8 (I have it.. it will be years before i figure all that mess out...... I typically end up using specific programs for specific purposes) (such as adobe photo shop or swismax)

 

 

 

Im not sure but for item # 2 it seems you would almost have to have a "working" aplication (copy of your actual) on your desk top to see how it all looks and works. Then upload the changed pages once you sure it works after changes are made. But I don't know about these things.

 

 

PS. The admin panel theme editor for phpbb is a nice idea but it is very limited.

 

 

 

 

Thanks for your time

 

 

Cappy

Share this post


Link to post
Share on other sites

As for the php editor item #2 i am sure that fuctionality changes verses appearance changes are quite differrent in difficulty. I am more interested in this case in appearance changes and layout.

I guess some functionality will be involved in appearance changes as well to some extent except for some minor changes..

Share this post


Link to post
Share on other sites

I agree with the suggestion to remove content from code.

 

I've been trying to look into integrating the code base with a simple content management system and it's incredibly difficult to read the code.

 

I definitely agree with using Smarty or some other templating engine to display everything. It would make it much easier to style your portal however you want.

Share this post


Link to post
Share on other sites

An appearance table needs to added to the database, to allow what is called soft code.

 

For example the color of the column headings on a page would be stored in the database and could be changed in the admin panel. You might even prompt a color pallet in the admin panel to help the admin select the color.

 

This concept could work for colors, fonts and other things.

 

Templates are OK, but just more hard code. If you want a truly flexible product, you should soft code as much as possible.

 

This eliminates users from having to learn to alter files and code.

 

It makes upgrades less painful.

 

All in all it makes the product more like an upscale business software

 

Just my plugged nickel.

Share this post


Link to post
Share on other sites
An appearance table needs to added to the database, to allow what is called soft code.

Just a word of advice, using terms like "what is called soft code" comes across as exceptionally patronising.

I'm a proffessional PHP developper, adopting an MVC approach within PHP to seperate code and content.

The only time I've ever heard the terms hard coding and soft coding regard paramaters like the base_url of a site beign coded in in every instance it's needed as opposed to a $cfg['base_url'] variable, or some such.

 

For example the color of the column headings on a page would be stored in the database and could be changed in the admin panel. You might even prompt a color pallet in the admin panel to help the admin select the color.

That would end up with an exceptionally bloated database, because in order to give control over the html, you'd need database entries for every box in the system, meaning that every time you want to add a new piece of html you have to add a new cell to the database, lowering efficiency by creating more need for database connections.

 

Templates are OK, but just more hard code.

Templates are not hard coding. Templates aren't coding at all, they're layout.

 

If you want a truly flexible product, you should soft code as much as possible.

I really can't see where you're coming from here.

 

This eliminates users from having to learn to alter files and code.

And increases overhead by needing a database query per-box per-paragraph per-page.

 

It makes upgrades less painful.

But running the system more painful and slower.

 

All in all it makes the product more like an upscale business software

No. It really doesn't.

Share this post


Link to post
Share on other sites
Just a word of advice, using terms like "what is called soft code" comes across as exceptionally patronising.

I'm a proffessional PHP developper, adopting an MVC approach within PHP to seperate code and content.

 

I've been a working developer since 1968, but I'll assume you know it all.

 

Thanks for the kind words. :D :D

Share this post


Link to post
Share on other sites
I've been a working developer since 1968, but I'll assume you know it all.

 

Thanks for the kind words. :D :D

Ever thought about catching up?

Share this post


Link to post
Share on other sites

Hey how about that button in the admin panel to turn off all traces of a cart, checking out, or credit card processing. ;)

 

I can see we have 2 experts reporting in maybe they could help. :-"

 

 

I did try a couple of the contirb's without sucess :'(

Share this post


Link to post
Share on other sites
I second the above!

 

But as far as templates go -

What would be the most useful (and could be a lot of fun in use also), would be a sort of Template Creator as a partner program packaged along with osCommerce - wherein you could create your own template design(s), and then integrate those with osCommerce.

 

That would be the ultimate in cool. No matter how great a particular template is, everyone's site serves totally different needs. It is impossible to serve all without a template creator tool. And man, how much fun would that be??? More fun than a video game!! One could change their entire site such by creating a new template and then switching over into it. If all that were required to use it, was to learn css or the specifics of the tool, (and no php code ever having to be monkeyed with for anything regarding design and layout), sites would become more and more interesting and unique, and then the buzz would be unstoppable.

 

Sure CREloaded versions sort of already work in a template way - if you are able to create a template and integrate it by hand. What we need is a way to separate the look/feel template for the designing portion, then merge the whole thing like magic! Is it impossible? Like how csszengarden works (amazing that one document can change everything so dramatically, it's brilliant!) - apply that sort of concept in a user-friendly format. Wow!!

 

(Does a contribution similar to this concept exist for current osCommerce...? Haven't found one yet so I think this is still untraveled territory)

 

Conquer this, and yahoo and Miva and zencart will get knocked onto their poor little bums as everyone leaves to build sites in oscommerce with the most freedom of self-design that's available anywhere.

 

Good luck with the project!

:thumbsup:

 

 

Hi BlissedGirl,

 

I found this feature available in webshaper e-commerce engine. Basically it uses XSLT templates to easily change the layout of the store.

 

Not only that, you can easily upload your template, and the whole layout will change.

 

You can also allow the merchants to create as many static pages they wanted. But linking to it, must be changed manually on the template file (just edit the file in the control panel).

 

Best, of all, you can backup the whole layout, switch to a new one. And if you don't like, you can switch back to the original one.

 

And a final note, you can easily change products layout or form styles using CSS, because it puts emphasis on css editing, rather than putting the style into the HTML.

 

You can check out the demo at

 

http://www.neowave.com.my/demo/

Share this post


Link to post
Share on other sites

HELLO,

I AM FROM BRAZIL, THERE IS SOME THING WRONG WITH MY SHOP, THANKS - CARLOS MAZUCATO CARLOS@SALVADORBR.NET

WWW.PAPAGAIOMUSIC.COM/SHOP

 

TKS

 

 

Current lay-out is OK

Header

Headerbar

Main area, 3 col lay-out, 3 row boxes, left center and right

Footerbar

Footer

 

Lay-out incl. buttons by stylesheet.css

Navigation must be assured with JS turned OFF

 

Very much looking forward to the result :D

Share this post


Link to post
Share on other sites

I have looked at other carts that have a drop down menu system. That would be a great template. I sell candles. I would like the customer to be able to choose a size, then have a drop down menu to choose the scent.

Share this post


Link to post
Share on other sites

Anyone,

 

So, I was planning on using a Monster Template that claims to be an "OSCommerce" tempate. What does that mean when they call it that? For example, in Mambo there are mambo modules and if you get one you simply browse to the module file and Mambo installs it. Are the inferring that level of functionality or something else? Here is where I was planning to get my templates from:

 

http://www.templatesfree.net/search.html?category=84

 

Above link shows what they are calling "OSCommerce" templates. Is anyone familiar with this or know what exactly I would be getting for my money and how easy it would be to integrate with my OScommerce cart at bluehost? I know a little bit about integrating PHP scripts and back end stuff but really new at CSS a such. Thanks for any advice.

 

Thanks!

 

David

Share this post


Link to post
Share on other sites

I would like to see the use of multipul stylesheets that could be changed trough the admin panel E.G.

orange.css green.css red.css. I would also like to see roll-over image buttons made using css I have them on one of my sites. My site feerfirst.

Share this post


Link to post
Share on other sites

×