Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Simple Template System (STS) README.txt v1.3

Contribution Author: Brian Gallagher @ DiamondSea.com

Contribution Author Email: [email protected]

 

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

WHAT IT DOES:

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

Lets you create simple HTML templates to customize the look and feel of OSC.

 

You simply create an HTML page that looks the way you want it to and put in

placeholders for the various elements wherever you want to position them.

 

For example, you would put "$cartbox" wherever on the page you want the

Shopping Cart box to appear. Put "$categorybox" where you want the Categories

box to appear. Put "$content" wherever you want the main page

content (the central part where all the magic happens) to appear, etc.

 

It does this by changing only a few /catalog/includes/ files, leaving all

other files untouched, making it easy to add other contributions later.

 

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

BONUS FEATURES: Simple HEADER TAG CONTROLLER Integration

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

This contribution also allows you to use WebMakers.com's

Header Tag Controller contribution without having to modify every file on

the system. Just copy the Header Tag Controller's include files into place

and STS will automatically add them to all pages without having to modify

every PHP script in the /catalog/ directory.

 

STS will auto-detect if Header Tag Controller is installed and use it if

available.

 

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

HOW TO INSTALL:

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

 

Installation Instructions are found in the readme.txt file included in the package. Please read the readme.txt file for a list of installation instructions, new features, new variables and other enhancements to STS.

 

 

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

HOW TO USE:

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

Just modify the

 

/catalog/includes/sts_template.html

 

file to look however you want. Use stylesheet settings or HTML setting to

provide a custom look and feel to your site and arrange elements wherever you

like them.

 

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

SUPPORTED TAGS:

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

Here are the tags that are supported so far (more sure to come in later

versions):

 

$headcontent: Put this string in your <head> section so that it can insert

the dynamic head content and javascript on pages that require it. This will

probably require putting the $headcontent in the <head> section in the source

code. It's a pain to do it this way, but it was the only way I could get it

working. Sorry!

 

<!--$headcontent--> : You can use this commented format of $headcontent to

keep the word "$headcontent" from displaying in your web authoring software.

 

NOTE: Do not put <title>...</title> tags in your header. It will be added

as part of the $headcontent variable, along with the Description and Keywords

meta tags if you have the WebMakers.com's Header Tag Controller contribution

installed.

 

$cataloglogo: The OSC logo and link

$urlcataloglogo: The URL used by the $catalog logo.

$myaccountlogo: The MyAccount graphic and link

$urlmyaccountlogo: The URL used by the My Account function

$cartlogo: The Cart graphic and link

$urlcartlogo: The URL used by the Cart function

$checkoutlogo: The Checkout graphic and link

$urlcheckoutlogo: The URL used by the Checkout function

$breadcrumbs: The "Top > Catalog > whatever..." breadcrumbs text and links

$myaccount: The text version of "My Account" and link. Changes to "Logoff" if logged on.

$urlmyaccount: The URL used by the MyAccount function.

$cartcontents: The text version of the "Cart Contents" function.

$urlcartcontents: The URL used by the MyAccount function.

$checkout: The text version of the "Check Out" function.

$urlcheckout: The URL used by the "Check Out" function.

 

$categorybox: The Category box

$manufacturerbox: The Manufacturer box

$whatsnewbox: The What's New box

$searchbox: The Search box

$informationbox: The Information box

$cartbox: The Shopping Cart box

$maninfobox: The Manufacturer Info box (blank if not used on a page)

$orderhistorybox: The Order History box (blank if not used on a page, ie: use not logged in)

$bestsellersbox: The Best Sellers box

$specialfriendbox: Either the Specials box or the Tell A Friend box (depending on page viewed)

$reviewsbox: The Reviews box

$languagebox: The Languages box

$currenciesbox: The Currencies box

$content: The main content of the page (the middle of the page)

$date: The current date

$numrequests: The "XXX requests Since DATE" text

$counter: The page view counter

$footer: The footer output from footer.php

$banner: The banner output from footer.php

 

$sid: The string for the Session ID in the format "SessionIdVarName=WhateverTheSessionIdIs"

 

 

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

DEBUGGING:

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

In the /catalog/includes/application_bottom.php file you can see the

following settings (near the top of the file):

 

$display_template_output = 1;

$display_normal_output = 0;

$display_debugging_output = 0;

 

Display_Template_Output (the default setting) will cause it to display the

template versions of the pages.

 

Display_Normal_Output will cause it to display the non-template version of

the pages.

 

Display_Debugging_Output will cause it to display debugging information

showing all of the blocks of data that it is using and how it translates

them into template variables.

 

You can use any or all of the settings in any combination. If you have both

Normal and Template output, the Template output will be displayed first.

 

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

REMOTE DEBUGGING:

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

You can toggle the debugging options via URL options. You can use the

following parameters in your URL to turn on/off options from your browser

 

sts_template=1 Turns on the Template display

sts_template=0 Turns off the Template display

sts_normal=1 Turns on the Normal display

sts_normal=0 Turns off the Normal display

sts_debug=1 Turns on the Debugging display

sts_debug=0 Turns off the Debugging display

sts_version=1 Turns on Version Number display

sts_version=0 Turns off Version Number display

 

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

SUPPORT:

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

 

For support, please post to this thread.

Edited by sparky

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

You can download the newest version of Simple Template System (STS) here:

 

http://www.oscommerce.com/community/contributions,1524

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

There are a couple great changes in STS 1.3:

 

Added Auto-detection and use of the WebMakers.com Header Tag Controller contribution. STS now manages the <title> and <meta> tags, so you no longer have to modify every php file in the catalog directory to support it.

 

Added a commented $headcontent variable. Use

<!--$headcontent-->

in your <head> section in sts_template.html and it won't show "$headcontent" on the top of your page in Dreamweaver or other editors. Note that you must put the tag EXACTLY as it appears above, with no spaces or anything else in the comment tags.

 

Changed template.html to sts_template.html to make it stand out and fit in with the new naming scheme. There are also new configure.php variables you need to set. See the Readme.txt for details.

 

Added a $sid variable. I'm not positive yet, but I suspect that this will be needed for some fancy sts_template.html layouts where you have image-map based menus.

 

Added a $title variable. You shouldn't use it normally, you should use the $headcontent or <!--$headcontent--> variable. But it's there if you need it for javascript or something.

 

Changed the file layout and naming system and internal variable names to be even easier to make future changes to the /includes/ files when working with other contributions.

 

Enjoy!

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

This template system work fine on http pages. I've installed version 1.2

 

Just download now 1.3 for install.

 

But there a problem, with https pages.

 

Whe go to https for confirm buy, if system it's configured with https, $content show pages on https, and other $ ($cartcontents, $information, ..) show href with http links.

 

That produces a lot of windows alerts on IE and other browsers.

Link to comment
Share on other sites

This template system work fine on http pages. I've installed version 1.2

 

Just download now 1.3 for install.

 

But there a problem, with https pages.

 

Whe go to https for confirm buy, if system it's configured with https, $content show pages on https, and other $ ($cartcontents, $information, ..) show href with http links.

 

That produces a lot of windows alerts on IE and other browsers.

Link to comment
Share on other sites

This template system work fine on http pages. I've installed version 1.2

 

Just download now 1.3 for install.

 

But there a problem, with https pages.

 

Whe go to https for confirm buy, if system it's configured with https, $content show pages on https, and other $ ($cartcontents, $information, ..) show href with http links.

 

That produces a lot of windows alerts on IE and other browsers.

Did it work in the 1.2 version? I don't think I've changed anything that should have changed it between 1.2 and 1.3.

 

Do you have a URL that I can take a look at?

 

- bg

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Sorry, for inconvenients.

 

My shop. not a fresh install of 2.2MS2... just install a fresh 2.2MS2 a nd work fine.

 

Sorry for the post and a lot of thanks for great work.

 

Just testing now with 1.2 version...

Link to comment
Share on other sites

std_display_output.php isn't on v1.3 zip file on contribution.

Oops! My mistake.

 

I just uploaded STS v1.4 which has the sts_display_output.php file in it.

 

That's what happens when you try to package a contribution at 2:30AM! :-)

 

Incidentally, for Release-specific postings, I will use the Heart Icon on the message list to help flag general interest posts from support posts.

 

- bg

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

thx for this great contrib - but how do i add for example infoboxes - newsdesk or other contribs ?

Short Version:

 

In /includes/column_left.php: Duplicate the code in column_left.php that you find around the require(BOXFILENAME) and make sure that the $sts_block_name has the correct name for the block ABOVE it. This is the name you'll use for the variable in the sts_template.html file.

 

NOTE: I moved ALL boxes into column_left.php to make maintaining it easier so you don't have to figure out which (left or right) file the boxes are stored in. If you want to put stuff in column_right it will work, but it's easier to just leave them in column_left.php.

 

In /includes/sts_display_output.php: In the Create custom boxes

section, add a new line like this:

 

$template['newsdeskbox'] = strip_unwanted_tags($sts_block['newsdeskbox'], 'newsdeskbox');

 

That should be all you need to do. In the above example, you can then use $newsdeskbox as a variable name in your sts_template.html file.

 

If you need more details, let me know.

 

- bg

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Super contrib helps a lot to change the look and feel of the standard osc, one small problem I seem to be having after update v1.4 I am unable to change the Logo image and name.

Here is the header code which I think is in header.php that needed changing? or am I wrong plz help.

 

<?php

/*

$Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

if ($messageStack->size > 0) {

echo $messageStack->output();

}

?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><?php echo tep_image(DIR_WS_IMAGES . 'adminlogo1.gif', 'Easypcs - Serious Solutions', '204', '50'); ?></td>

<td align="right"><?php echo '<a href="http://www.easypcs.co.uk">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a>  <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a>  <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?>  </td>

</tr>

 

Thx

Link to comment
Share on other sites

This looks to be a terrific contribution. Is there a site somewhere that we could look at to see how an implementation works?

I'm working on one now, and building the features to make it even easier into v1.5 which should be out fairly soon. When I get a good demo site up I'll post a link to the site and the template page.

 

Anyone else got a site they've already done? Show us what you did!

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Super contrib helps a lot to change the look and feel of the standard osc, one small problem I seem to be having after update v1.4 I am unable to change the Logo image and name.

Here is the header code which I think is in header.php that needed changing? or am I wrong plz help.

Glad you like it. There's even more cool stuff coming soon in v1.5 as I develop my site with it and add more features to make the design process simpler.

 

To answer your question, STS doesn't use the code from the header.php code for the image. In /catalog/includes/sts_display_output.php you can change this line:

  $template['cataloglogo'] = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>';
 $template['urlcataloglogo'] = tep_href_link(FILENAME_DEFAULT);

 

However, a better solution would be to simply put your own <img> tag in the /catalog/includes/sts_template.html with your HTML editor like this:

<img src="/path/to/image.gif/" href="$urlcataloglogo" alt="Your Site Name">

 

You should use absolute URL's (ones that start with a slash) for your image src= values since OSC uses <base> tag to change the default page location which could confuse your browser otherwise.

 

This way you don't have to modify any of the PHP code, which is the design goal of this contribution.

 

Just for the heck of it, I will start using the smiley face (:) ) icon when I post answers to questions, and heart icons for version/release information. Hopefully this may make it easier to scan through the threads looking for answers to your questions.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

I love the template system, I had just installed 1.2 4 days ago.. it worked great..

I just hope it isnt a big deal to upgrade to 1.3.. it doesnt seem so, but I already customized some things :(

 

Good stuff! Thanks for the contrib!!!!

 

 

Should i wait till 1.5 to upgrade?

Edited by HandCrafted
Link to comment
Share on other sites

I love the template system, I had just installed 1.2 4 days ago.. it worked great..

I just hope it isnt a big deal to upgrade to 1.3.. it doesnt seem so, but I already customized some things :(

 

Good stuff! Thanks for the contrib!!!!

 

Should i wait till 1.5 to upgrade?

 

I'd switch over to v1.4, just because it does some things better (such as being integrated with the Meta Tags Controller contrib), is better laid out and you really don't have to do much to upgrade other than copy the files in and add a couple more lines to the end of configure.php. And the template.html file name is changed to sts_template.html.

 

What have you customized? Anything in the files that STS modified? If not, you can just install the new files and update configure.php and you're done.

 

If you have modified the STS files, what did you do? If you changed them, it means that I'm not doing things right, as my goal is to not have a reason for anyone to have to change the code (except for adding boxes).

 

Actually, I'll fix that problem too, now that I've thought of it. :-) I'll add an sts_user_modifications.php (or something like that) where you can put in your custom code, so you put custom stuff in there without having to worry about getting it clobbered with the next version's updated files. Sound good?

 

Do you have a link you can post to the site and the template.html file so that the hungry masses here can see what people are doing with it (and how you're doing it)? :)

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Super contrib helps a lot to change the look and feel of the standard osc, one small problem I seem to be having after update v1.4 I am unable to change the Logo image and name.

Here is the header code which I think is in header.php that needed changing? or am I wrong plz help.

Glad you like it. There's even more cool stuff coming soon in v1.5 as I develop my site with it and add more features to make the design process simpler.

 

To answer your question, STS doesn't use the code from the header.php code for the image. In /catalog/includes/sts_display_output.php you can change this line:

 ?$template['cataloglogo'] = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>';
?$template['urlcataloglogo'] = tep_href_link(FILENAME_DEFAULT);

 

However, a better solution would be to simply put your own <img> tag in the /catalog/includes/sts_template.html with your HTML editor like this:

<img src="/path/to/image.gif/" href="$urlcataloglogo" alt="Your Site Name">

 

You should use absolute URL's (ones that start with a slash) for your image src= values since OSC uses <base> tag to change the default page location which could confuse your browser otherwise.

 

This way you don't have to modify any of the PHP code, which is the design goal of this contribution.

 

Just for the heck of it, I will start using the smiley face (:) ) icon when I post answers to questions, and heart icons for version/release information. Hopefully this may make it easier to scan through the threads looking for answers to your questions.

 

- Brian

Thanks for the fix, as you can see I am new to php and osc but I am trying to learn.

 

Keep up the good work and thx

Link to comment
Share on other sites

Hi all, this contribute is fantastic, but i do not understand how to change the box layout.

Can anyone help me, tnx all

You can't change the box layout with STS. You'd have to change the stylesheet and/or the PHP script that creates the boxes depending on what you want to change.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

great contrib!  however, I can't seem to locate the

$display_template_output = 1;

  $display_normal_output = 0;

  $display_debugging_output = 0;

 

in the application_bottom.php file?  Am I missing something?  I have version 1.4 installed.

 

THanks

It is located near the top of sts_display_output.php.

 

You can also control it from your browser by adding &STS_DEBUG=1 to turn on the debugging or other options (see the README.txt file in the contribution).

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Thank you Brian, great contribution.

 

You can see STS 1.4 implementation in action on my demo site.

Your Welcome! Your site looks great!

 

Can you post a link to your Template.html file so people can see how you set it up?

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...