PDA

View Full Version : HTML template (and system) for the BTS



paulM
06-15-2005, 06:08 AM
Layout you osCMax store by editting one HTML file now!

As of osCMax v2.0 RC1 (gratulations Michael, I am impressed!), osCMAX includes the new BTSv1.5. And that enables osCMAX users to use the HTML template for the BTS (http://www.oscommerce.com/community/contributions,3127) very easyly.

It's a special BTS template which separates the PHP and HTML from the mainpage template file. So actually it is an (STS alike) template system. It is still very basic, but it should allow you to alter the looks of your store for about 95% by only editting main_page.html (and the stylesheet of course).

Another "funny" feature is that the separated PHP also has been moved to a template file, so if changes to the main_page PHP code are needed you simply edit main_page.code.php .

Note that the included main_page.tpl.php file has been transformed to a template controller. So do not edit it, unless you know what you are doing.

Installation only rquires you to copy the contents of the zip to your templates dir, no files are overwritten or editted, so it only should take a minute. (choose "HTML" as the default template in your admin to activate it)

My time and energy are limited, but I will try to give some support here if needed.

hth,
Paul

michael_s
06-15-2005, 06:44 AM
Paul,

Yes, this should help even the most html challenged of the community get a good head start on things. As always, I think your contributions to the community are top notch and highly recommend them to anyone. The power and flexibility of your improvements to BTS are huge! That is why we use BTS in osCMax.

paulM
06-15-2005, 11:20 PM
Thanks for the compliments Michael, I am glad that you like it so much :) But of course it's a small contribution compared to the osCMax project itself, and most credits should still go to Brenden, he created the first BTS version (which must have been an awfull lot of work).

A nice thing I recently found out (allways have thought it, but wasn't 100% sure until I heard it from hpdl himself recently), is that MS3 will have the same template structure as the BTS has. This will make the switch (I don't say upgrade, because I doubt if anyone really will be able to really upgrade) to MS3 a lot easyer for BTS users and thus for osCMax users too. And this also might make it relatively easy to add the same features to ms3 as the BTS currently has, like this HTML template, and template switching.

kolamon.com
06-18-2005, 01:18 PM
Im tring to figure this out. Is there any guides to this? I would like to use an HTML template on my shop. Thank You

paulM
06-19-2005, 02:30 AM
Im tring to figure this out. Is there any guides to this? I would like to use an HTML template on my shop. Thank YouNo other guides than the included readme and this thread. Is very basic, so there isn't much more to explain for now I think.

Just copy the HTML template dir (and included files) to the templates directory of your shop (and set it as default template in "admin::Configuration::My Store::Default Template Directory") and start editting the included "main_page.html" file. What else do you need to know?

miahac
06-24-2005, 06:33 AM
WOW! I love this contribution. This makes the BTS exactly what I wanted. Even the cSS is superclean, but the template references a stylesheet.htm that does not exist and there are many tags used in the html that are not present in the stylesheet.css

paulM
06-25-2005, 06:24 AM
WOW! I love this contribution. This makes the BTS exactly what I wanted.Thank you :)


but the template references a stylesheet.htm that does not exist and there are many tags used in the html that are not present in the stylesheet.cssThat is both correct! :D

There are reasons for it though:
1) there is one static and one dynamic stylesheet linked in the template. Both are used for the same stylesheet, but for different ways using it: the static link is used when you are looking at the html file itself (so for testing and such), and the dynamic link enables the script to load the stylesheet from the right template directory. It's a hack, but I could not think of a nicer way to make it possible to view the static template including it's styles and at the same time use the dynamic stylesheet linking. If it bothers you you can safely remove the static link of course.

2) the included html template and it's classes are only an example to explain how tags and classes should/can be inluded. The idea is (tmho) that you create (or buy or whatever) a template you like, and add the tags you need, and then replace the included html template by your own new template.

hth,
Paul

paulM
06-28-2005, 06:55 AM
there are many tags used in the html that are not present in the stylesheet.cssbtw this is quite normal practice. That way you often only need to edit stylesheet to add styles. Else you would also have to add a class to your template for allmost every change you want.

NickW
07-04-2005, 01:21 PM
For a new template, I understand that if you want to change the outer layout then you edit the main_page.html, but what if you want to change some html for a specific page eg create_account? Do you add a content dir to your new template dir and only add your modified file create_account.tpl.php to the content dir?

newtothis
07-04-2005, 04:35 PM
what is the tag for affiliate?
thanks!

paulM
07-04-2005, 11:44 PM
For a new template, I understand that if you want to change the outer layout then you edit the main_page.html, but what if you want to change some html for a specific page eg create_account? Do you add a content dir to your new template dir and only add your modified file create_account.tpl.php to the content dir?Exactly :)
Note: not sure if it was clear already, but the content templates are not HTML templates (that would (allmost) be impossible with the current osC version).

/************************************************** ********/


what is the tag for affiliate? Ehhhh...... good question. I assume you are asking how to add a small sidebox for it, but there isn't any tag for affiliate yet. osCDOX has some more boxes than a standard osC install (I just realize).

It's noty difficult to add new boxes though. (A discussion about adding a loginbox can be found at forums.oscommerce.com/index.php?showtopic=146868)

In general it works like this:

1) first you need a BTS compatible box file (like the ones in includes/boxes/*.*). I assume it's already there in this case, because osCMAX has the affiliate box included.

2) Then you add a new tag to main_page.html wherever you would like the box to appear.
For example like this:
<div class="smallBox" id="whatsnewbox">{affiliatebox}</div>(the <div>, class and id are all optional, just adding "{affiliatebox}" (without the quotes) only might be enough for you)
Now the shop should show the tag "{affiliatebox}" (i.s.o. the actual box content)

3) To make it show the box in stead of the tag, some code needs to be added to "main_page.code.php". This code will be executed when the tag is found in the HTML template.

For example like this:

//begin{affiliatebox}
require(DIR_WS_BOXES . 'affiliate.php');
//end{affiliatebox}
This should work as it is for the affiliate box.

Additional code may be added, i.e. if you need to hide a box for certain pages (like you do not wan't a login box to show up whenever someone's already logged in). (normally these boxes are included in column_right.php and column_left.php, but inluding them this way makes the template much more flexible).

/************************************************** ********/

Another note: this template is not compatible with the box controller (or whatever it is called). I is possible/easy to make a compatible version, but I doubt if it would be very usefull. Since (re)moving deleting the box tags inside the HTML template file is so easy.

hth

NickW
07-05-2005, 12:46 AM
Thanks Paul for the confirmation. If I want to add a page do I essentially add a new code file at the top level in the catalog dir which points to a new template file via the main template as before?

paulM
07-05-2005, 01:00 AM
Thanks Paul for the confirmation. If I want to add a page do I essentially add a new code file at the top level in the catalog dir which points to a new template file via the main template as before?Sounds ok to me, adding new pages is not any different with or without this contribution.

Again a little note :) : the only reason the small sideboxes are treated differently is because I think having an easy to edit HTML template would not be very usefull if you are still stuck to the left and right column layout. That is why I made it possible to add single boxes directly to the main template (allthough the "old way" also still is possible, using the column_left.php and right column_right.php, I think there's a note about it in the readme).

blackcactus
11-09-2005, 06:34 PM
where is the main_page.html
I see lots of main_page_tpl but no main_page.html

paulM
11-10-2005, 12:12 AM
Where did you search?

In here:
HTML template for the BTS (http://www.oscommerce.com/community/contributions,3127)?

blackcactus
11-10-2005, 05:32 PM
OK thanks , I have the template now, but not sure if you could explain,
goto http://www.blackcactusonline.com/catalog/index.php?tplDir=HTML
thats what it looks like , not understanding why doesnt it call blank items where these are

{headertags} {stylesheet} {javascript} {common}
Example of internal HTML link with {BTSsid} attached (only when needed).

{cataloglogo} {myaccountlogo} {cartlogo} {checkoutlogo}
{breadcrumbs} {myaccount} | {cartcontents} | {checkout}
{categorybox}
{manufacturerbox}
{whatsnewbox}
{searchbox}
{informationbox} {content} {cartbox}
{maninfobox}
{orderhistorybox}
{bestsellersbox}
{specialfriendbox}
{reviewsbox}
{languagebox}
{currenciesbox}
{banner}
{date} {numrequests}
Copyright (C) 2005 HTML template for the BTS by PandA.nl

deuce
11-16-2005, 02:14 PM
Does anyone have any decent templates for the BTS or know where to get some?

jpf
11-24-2005, 12:24 PM
You can try templates based on BTS from:

http://creloaded.com/Downloads/d_op=viewdownload/cid=5.html

Which does have BTS - However not sure of the version of BTS and there are diffences in the contributions - make sure you "compare" it to the "fallback" in MAX.....

A quick search I also found:
http://sourceforge.net/project/showfiles.php?group_id=71985&package_id=119333

(not free)
http://www.algozone.com/shop/default.php?povID=63
http://www.websitetemplatedesign.com/osc-max-v17-m-3.html



ALSO most changes can be done via the CSS file and changing the default graphics! Most other can be done by edit the main template file.


Good Luck