Default Module

STS 4: Default Module

4 Modules

STS 4 sub-modulesRecall that STS 4.5.8 (from hereon in, referred to as STS) comes with 4 modules (or sub-modules if you like). The Default module must be enabled to use STS at all.

Default Module

STS - default moduleThis is the main module. Must be enabled to use any of the others. Even if you just have only this one enabled, it will already make your designing job much easier.

In OSC Admin, you enable/disable it. There are few parameters you can set. For now, I am only dealing with the basic ones we need.

  • Use Templates? - i.e. Do you want to use STS?

    Set to true to enable
  • Files for normal template - i.e. What placeholder file(s) does your Default HTML Template file need?

    This is asking you which files the HTML Default Template File (sts_template.html) will need to use. Specifically it wants to know what placeholder file(s) contains the placeholders that will be used in sts_template.html). By default, this placeholder file is sts_user_code.php (which is in /includes/modules/sts_inc/)
  • Base folder - Where is the top-most STS folder that holds all your HTML-template files?

    as I alluded to above, this should really be called "Base Template Folder" for the sake of clarity. So here it is asking you what is the STS top-most parent folder that holds all of your templates or template-folders? As we know, that would be sts_templates.
    STS- HTML template folders
    Now here you have to specify 2 more pieces of information: it needs to know the path to sts_templates relative to the osc installation (or "catalog" as it is called in most documentation) and
    you need to end the path with a trailing forward-slash (/). Hence:
    Base folder = includes/sts_templates/
  • Template folder - Which folder is your default or Working Template folder? (i.e. which folder containssts_template.html)?

    STS - working Template folderAs I said earlier, we would be choosing the /test/ Template folder as our working folder. If you had another Template folder you wanted to use and you wanted the default Template-file to still be sts_template.html, then you would move (or copy) that file over to your Template folder of choice. The Working Template folder you choose is just the folder that contains all your HTML template files and all you have to do to choose/change the Template folder you want to use, is by letting STS know - via the osc's Admin > Modules; just as we are doing now.
  • Default template file - What is the name of your default template file?

    By now you already know the answer right? ==> sts_template.html

STS Default module: Summary

STS Default module summaryI know the smarter ones amongst you will find this silly but it took me a quite awhile before I could see these connection clearly. So I am including a summary-logic here for those of you who might unenviably find themselves in a similar situation as myself.

What we have done here is:

  • We said "yes" we want to use STS contrib and we did this by activating/enabling the Default module.
  • We will be using the template-file sts_template.html as our design/layout file for our pages.
  • This file is located in the template-folder test..
  • ..which is found in (catalog)/includes/sts_templates/
  • And the placeholders that sts_template.html will need are to found in the placeholder file sts_user_code.php

OK! Great! But what do you do now, right? Well you can now simply go to your chosen default HTML template file:
/includes/sts_templates/test/sts_template.html
Open it in any HTML editor, and make changes to layout as you like.
And if you need to know either the definition or more placeholders you can use, please refer to Bill Kellum's STS v4.5.8 User Manual (which comes with the STS module when you download it). Or if you prefer, you can download this STS v4.5.8 User Manual (in .pdf format; approximately 273 kb. This is Bill Kellum's documentation but I just made it into .pdf format as it is safer for internet downloads).

To download and save the file:
Right-click > Save Target (or save link) to ... (specify where you want to save it to on your computer).

STS Default module: Footnote

Now that you hopefully have a clearer picture in your head about the Default module, let me just add a few more tiny facts (which you will also find somewhere in the STS User Manual or in the installation instructions).

When you open up the folder /sts_inc/ containing the placeholder files, you will see that there are a number of placeholder files in there already. If you wanted to use some placeholder that is in one of this other placeholder files (in addition to the default sts_user_code.php), then in your Default module setup, you just add the name of the additional placeholder file(s) after sts_user_code.php separated by semi-color (;).

For example, if you wanted to use a placeholder file you created and named extras.php, then your setup would look like:
Files for normal template = sts_user_code.php;extras.php

You can also create your own placeholders and put it in a new file or in one of the existing placeholder files. Then remember to "tell" STS as per above. If you create a new placeholder file, you must put it in the same folder as with all the other placeholder files - i.e. in folder /sts_inc/

A sample of the format needed to create a new placeholder can be found in:
includes/modules/sts_inc/sts_user_code.php

Next we will be going to examine the Product Info module. That's because I find it very useful as it gives me subtle but powerful control over how my product pages displays. If you have ever tried to change the look of a os Commerce file, you will know what I mean!

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

 

Healthful Soulful Things

Custom Search