Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I meant something like this:

 

In first template, you only detect the language in use, then include another template from there, like include (DIR_WS_TEMPLATES . 'mytemplate_'. $languages_id.'.html');

The thing is that $languages_id is not available within the template, so you have to add global $languages_id; before the include.

 

You should search application_top.php to find exactly what is the variable name, as far as I remember it's $languages_id.

 

So, your language-templates will be totally separated.

 

- Chris


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

hi all,

 

we get server http error 500 on requests to our sts-powered shop.

we've narrowed it down to sts.

if these lines of code:

 

// START STS 4.5

require (DIR_WS_CLASSES.'sts.php');

$sts= new sts();

$sts->start_capture();

// END STS

 

are commented out in /includes/application_top.php the error is gone.

which cannot be done (permanently) since the whole shop depends on sts.

 

the error started showing up after our hosting service updated to a newer version of apache (from 1.x to 2.x). it also runs php 5.2.3 or 5.2.4.

we use sts_htc bundle (http://www.oscommerce.com/community/contributions,4456 10 may) with the sts 4.5.5 patch (http://www.oscommerce.com/community/contributions,1524 22 aug).

 

any advice on mods to the sts.php required to make it all work again?

 

thanks.

Share this post


Link to post
Share on other sites
hi all,

 

we get server http error 500 on requests to our sts-powered shop.

we've narrowed it down to sts.

if these lines of code:

 

// START STS 4.5

require (DIR_WS_CLASSES.'sts.php');

$sts= new sts();

$sts->start_capture();

// END STS

 

are commented out in /includes/application_top.php the error is gone.

which cannot be done (permanently) since the whole shop depends on sts.

 

the error started showing up after our hosting service updated to a newer version of apache (from 1.x to 2.x). it also runs php 5.2.3 or 5.2.4.

we use sts_htc bundle (http://www.oscommerce.com/community/contributions,4456 10 may) with the sts 4.5.5 patch (http://www.oscommerce.com/community/contributions,1524 22 aug).

 

any advice on mods to the sts.php required to make it all work again?

 

thanks.

In your application_top.php file, does the last lines appear as so:

 

 

 // START STS 4.5
 require (DIR_WS_CLASSES.'sts.php');
 $sts= new sts();
 $sts->start_capture();
 // END STS

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// set which precautions should be checked
 define('WARN_INSTALL_EXISTENCE', 'true');
 define('WARN_CONFIG_WRITEABLE', 'true');
 define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
 define('WARN_SESSION_AUTO_START', 'true');
 define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
?>

Also, your includes/classes/sts.php file should look as so:

 

<?php
/*
 $Id: sts.php,v 4.5.5 2006/23/09 22:30:54 Rigadin2 Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com/"]http://www.oscommerce.com[/url]

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License
 * 
 * STS v4.5.5 by Rigadin2, [url="http://www.osc-help.net/"]www.osc-help.net[/url]
*/

require (DIR_WS_FUNCTIONS.'sts.php');

class sts {
 var $sts_block, $template,
  $display_template_output, $display_debugging_output,
  $template_file, $template_folder;

 function sts (){
$this->update_from_url(); // Check for debug mode from URL
 $this->infobox_enabled = false; // infobox templates disabled by default.
 $this->is_button = false; // We are not processing an image button
 $this->buttons_folder = 'buttons'; // Set the button folder inside [template folder]/images/[language]/

 // Defines constants needed when working with templates.
 // v4.4: Moved constant definitions before check of template output, so constants are also available to pagegs not using templates
define('STS_TEMPLATE_DIR', MODULE_STS_TEMPLATES_FOLDER . $this->template_folder .'/'); // v4.4: Use of MODULE_STS_TEMPLATES_FOLDER instead of fixed path
define('STS_DEFAULT_TEMPLATE', STS_TEMPLATE_DIR . MODULE_STS_TEMPLATE_FILE);

 $this->default_content_template = STS_TEMPLATE_DIR . "content/sts_template.html"; // v4.5: Set the name of the default content template

 // Use template output if enabled or in debug mode (=only for admin)
if ((MODULE_STS_DEFAULT_STATUS == 'true') || ($this->display_debug_output == true))
  $this->display_template_output = true;
  else { 
 $this->display_template_output = false;
 return;
  }

 // Initialisation of variables
  $this->template = array('debug' => '', 
					 'headcontent' =>'',
					 'extracss' =>'');
$this->version= "4.5.5";

// Find the right template to use according to actual page and parameters. Displays normal output if no template returned
if ($this->find_template() == '') {
 $this->display_template_output = false; // If no template returned, do not use templates at all and exit
 return;
  }
  if ($this->read_template_file() == false) {
 $this->display_template_output = false; // If template file does not exist, do not use templates at all and exit
 return;
  }
 // Added in v4.3: check if infobox templates are enabled or not
 $this->infobox_enabled = ((MODULE_STS_INFOBOX_STATUS == 'true') ? true : false);
 } //end constructor

 function update_from_url () {
// Allow Debugging control from the URL
if ($_GET['sts_debug'] == MODULE_STS_DEBUG_CODE) {
  $this->display_debug_output = true;
}

// Defines constants needed when working with templates
if ($_GET['sts_template']) {
  $this->template_folder = $_GET['sts_template'];
} else {
  $this->template_folder = MODULE_STS_TEMPLATE_FOLDER;
}

 }  

 function find_template (){

 // Retrieve script name without path nor parameters
$scriptbasename = basename ($_SERVER['PHP_SELF']);

// Disable STS for popups: moved to sts_default module since v4.4

 // Check for module that will handle the template (for example module sts_index takes care of index.php templates)
$check_file = 'sts_'.$scriptbasename;
$modules_installed = explode (';', MODULE_STS_INSTALLED);
if (!in_array($check_file, $modules_installed)) $check_file = 'sts_default.php';

include_once (DIR_WS_MODULES.'sts/'.$check_file);
$classname=substr($check_file,0,strlen($check_file)-4);
$this->script=new $classname; // Create an object from the module

// If module existes but is disabled, use the default module.
if ($this->script->enabled==false) {
  unset ($this->script);
  include_once (DIR_WS_MODULES.'sts/sts_default.php');
  $this->script=new sts_default; // Create an object from the module	
}

$this->template_file = $this->script->find_template($scriptbasename); // Retrieve the template to use, $scriptbasename added in v4.4
return $this->template_file;
 }

 function start_capture () {
 // Start redirecting output to the output buffer, if template mode on.
if ($this->display_template_output) {
  // ob_end_clean(); // Clear out the capture buffer. Removed in v4.3.3
  ob_start();
}
 }

 function stop_capture ($block_name='', $action='') {
 // Store captured output to $sts_capture
if (!$this->display_template_output) return; // Do not process anything if we are not in using templates
  $block = ob_get_contents(); // Get content of buffer
ob_end_clean(); // Clear out the capture buffer
  if ($block_name=='') return $block; // Not need to continue if we don't want to save the buffer
  switch($action){
case 'box':
   $block = sts_strip_unwanted_tags($block, $block_name);
  $this->template[$block_name] = $block;
  break;
 break;
default:
  $this->template[$block_name] = $block;
  } // switch
 return $block; // Return value added in v4.3
 }

 function restart_capture ($block_name='', $action='') {
 // Capture buffer, save it and start a new capture
if (!$this->display_template_output) return;
$block = $this->stop_capture($block_name, $action);
  $this->start_capture();
 return $block; // Return value added in v4.3
 }

function array_capture ($array){
// Function added in v4.5 to merge a full array directly into template array.
  $this->template = array_merge($this->template, $array);
}

 function capture_fields (){
// If we use template, ask to module what file(s) to include for building fields
if ($this->display_template_output) {
  $fields_arr= explode(';', $this->script->capture_fields ());
}
return $fields_arr; 
 }

 function read_template_file (){
 // Purpose: Open Template file and read it

// Generate an error if the template file does not exist and return 'false'.
if (! file_exists($this->template_file)) {
  print 'Template file does not exist: ['.$this->template_file.']';
  return false;
}
// We use templates and the template file exists
// Capture the template, this way we can use php code inside templates

$this->start_capture (); // Start capture to buffer
require $this->template_file; // Includes the template, this way php code can be used in templates
$this->stop_capture ('template_html');
return true;
 } // End read_template_file


 function replace (){
global $messageStack, $request_type;

if (!$this->display_template_output) return;  // Go out if we don't use template
if (defined("STS_END_CHAR") == false) define ('STS_END_CHAR', ''); // An end char must be defined, even if empty.

// Load up the <head> content that we need to link up everything correctly.  Append to anything that may have been set in sts_user_code.php
// Note that since v3.0, stylesheet is not defined here but in the template file, allowing different stylesheet for different template.
$this->template['headcontent'] = $this->template['headcontent'].'';
$this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; 
$this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n";;
$this->template['headcontent'] = $this->template['headcontent'].'<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
$this->template['headcontent'] = $this->template['headcontent'].get_javascript($this->template['applicationtop2header'],'get_javascript(applicationtop2header)');

  $this->script->replace($this->template); // Module can make tricks here, just before replacing, like using own content template
// Add messages before the content
if ($messageStack->size('header') > 0) {
  $this->template['content'] = $messageStack->output('header') . $this->template['content'];
}

 // v4.5.4, error and info message from URL were never displayed, so add them before content.
 $this->template['content'] = $this->template['error_message'].$this->template['info_message'].$this->template['content'];


 // Manually replace the <!--$headcontent--> if present
$this->template['template_html'] = str_replace('<!--$headcontent-->', $this->template['headcontent'], $this->template['template_html']);
 // Manually replace the <!--$extracss--> with template['extracss']
$this->template['template_html'] = str_replace('<!--$extracss-->', $this->template['extracss'], $this->template['template_html']);

 // Automatically replace all the other template variables
if (STS_END_CHAR=='') { // If no end char defined for the placeholders, have to sort the placeholders.
  uksort($this->template, "sortbykeylength"); // Sort array by string length, so that longer strings are replaced first
}
foreach ($this->template as $key=>$value) {
  $this->template['template_html'] = str_replace('$' . $key . STS_END_CHAR , $value, $this->template['template_html']);
}
 }

function image (&$src) {
// Added in v4.4: use image from the template folder if exists.
  // Check only if STS is enabled.
if (MODULE_STS_DEFAULT_STATUS=="true" && $this->is_button ==false)
  if (file_exists(STS_TEMPLATE_DIR . $src)) $src = STS_TEMPLATE_DIR . $src;
 $this->is_button = false;
}

function image_button ($src, $language, $is_button = false) {
// Check if button exists in template folder.
// $is_button=true will cancel the check in function "image".

 $this->is_button = $is_button;
 // Check only if STS is enabled.
if (MODULE_STS_DEFAULT_STATUS=="true") {
$check_file = STS_TEMPLATE_DIR . 'images/'. $language . '/' .$this->buttons_folder . '/' .$src;
  if (file_exists($check_file)) return $check_file;
}
 return '';

}

// *****************************************
// Functions added for debug
// *****************************************   
 function add_debug ($text, $br=true) {
 // STS v4.1: Add debug text to the STS debug variable. If $br=false, then no line break added
$this->template['debug'].= $text . ($br ? "\n" : '');
 }

}  //end class
?>


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hello i have just installed the latest version of sts great package u guys have here and what looks to be a great support forum, If anybody could point me inthe right direction with one issue this would be great,

 

 

i template working fine, ive installed and tested the test template, all looks fine, so now im installing my own template so that the software fits in nicely with my site, basically so that my customers wont be aware that they have gone from my own personal work onto the oscommerce scripting, obviously this is just personal preferance and i dont htink it would make a difference either way.

 

anyway on with the matter at hand..

 

the manufaturers dropdown on the index is too big, by too big i mean its too wide, i have a table on the left hand side which the dropdown keeps hanging over into the content area,

 

http://theanglers.co.uk/shop if you look here you will see what i mean, anyway can anybody tell me which file i need to edit in order to alte the size, its not because the manufaturers names are long as its actually about double the width of the longest name.

 

 

help would be super...

 

 

Thanks in advance, the host

Share this post


Link to post
Share on other sites
...the manufaturers dropdown on the index is too big, by too big i mean its too wide, i have a table on the left hand side which the dropdown keeps hanging over into the content area,

 

http://theanglers.co.uk/shop if you look here you will see what i mean, anyway can anybody tell me which file i need to edit in order to alte the size, its not because the manufaturers names are long as its actually about double the width of the longest name.

I went to your site and it appears you found what you were looking for.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

I've just installed oscommerce 2ms2 via my webhost's control panel. I've uploaded STS 4.5.4 for 2.2MS2 and RC1 and STS v4.5 SP5 as per install instructions.

 

When I go to my shop's admin section to install STS via the modules section, it does not save the edit changes I make to Default. I'm trying to enable Use templates (true) but everytime I click update I keep seeing Use Templates (false) as if the changes haven't been saved at all. Why is this occuring?

Share this post


Link to post
Share on other sites

This is an osCommerce 2.2MS2 bug. Upgrade to 2.2RC1 or read little bit back in this thread, many many people have already ask this question, so you'll find the solution.

 

- Chris


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

Oops, sorry about that! :blush: I did entertain the notion of reading the thread start to finish but was deterred when I saw it was almost 200 pages long hehe

Share this post


Link to post
Share on other sites
I've just installed oscommerce 2ms2 via my webhost's control panel. I've uploaded STS 4.5.4 for 2.2MS2 and RC1 and STS v4.5 SP5 as per install instructions.

 

When I go to my shop's admin section to install STS via the modules section, it does not save the edit changes I make to Default. I'm trying to enable Use templates (true) but everytime I click update I keep seeing Use Templates (false) as if the changes haven't been saved at all. Why is this occuring?

 

See the following link:

http://forums.oscommerce.com/index.php?sho...p;#entry1117449


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hello, :thumbsup:

I need to help with 3 things:

 

1) I need to create a template for subdivisions: About us, Services and Portfolio that I have created. How can I create those templates? I did one for the index.php.html and for the sts_template.html but I don't know how I can do that for those subdivision.

 

 

2) The links that are in $categorybox don't work. When you click on the buttons they send you to the a page that looks like the index.php.html. How can I have those links working? Do I Have to create a special page?

 

3) How can I sell photos with my OSC? I want the customer buying the pictures and Downloading it after they pay automatically.

 

 

 

Please help me! Thank you

 

 

SXM

Edited by SXM

Share this post


Link to post
Share on other sites

Some answers...

 

1) You can create a different template for each page of your store: for conditions.php, create a template named conditions.php.html and it will automatically used.

 

2) Not sure to understand. You click a category link and you arrive on a page that looks like a category, is it displaying products? Or did you create index.php.html only for the main page of your store? The main page template must be named index.php_0.html, and the index module must be enabled.

 

3) That's possible with osC but with one problem: osC does not check that customer has paid before allowing the downloads. Can be ok with automatic payments. Check the Super Download Store contribution.

 

- Chris


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

Hello, I am going to write about the questions:

 

1) This one is perfect!!! Thanks!

 

2) It doesn't display products. It goes to index.php/cPath/22 but it shows just the default template. I was talking about index.php.html just as an example it is not the problem. Do you have any suggestions?

 

3) How can I active that options?

 

Thanks :thumbsup:

 

SXM

Share this post


Link to post
Share on other sites

Sorry!! :blink:

 

3) How can I activate the options?

Share this post


Link to post
Share on other sites
Hello, I am going to write about the questions:

 

1) This one is perfect!!! Thanks!

 

2) It doesn't display products. It goes to index.php/cPath/22 but it shows just the default template. I was talking about index.php.html just as an example it is not the problem. Do you have any suggestions?

 

3) How can I active that options?

 

Thanks :thumbsup:

 

SXM

SXM,

Turn "Use Search Friendly URLs" to False in your admin settings. This should take care of your link problems. This issue is not related to STS but how you have your shop misconfigured.

 

How can I active that options?
If you are meaning how you change the STS options, you would do this in your admin panel under "Modules - STS". :thumbsup: The STS User Manual is an excellent resource to answer your basic questions about STS.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

I am extremely new to STS, osCommerce and php, I had a reply to a previous post from someone claiming my template hasn't been installed properly - is it and how do I correct it if it isn't?

 

The template is stored in catalog/includes/sts_templates/artebits/index.php.html (this is the same as the default template sts_template.html)

 

The images used are the ones found in catalog/includes/languages/english/images/buttons

 

Also where do I configure $content on the template page. Instead of have a list of categories down the side of the page I would like to have a 5*2 grid of category images. Is this possible.

 

I hope that this is enough information for somebody to help me.

 

regards

Rob

Share this post


Link to post
Share on other sites
I am extremely new to STS, osCommerce and php, I had a reply to a previous post from someone claiming my template hasn't been installed properly - is it and how do I correct it if it isn't?

 

The template is stored in catalog/includes/sts_templates/artebits/index.php.html (this is the same as the default template sts_template.html)

 

The images used are the ones found in catalog/includes/languages/english/images/buttons

 

Also where do I configure $content on the template page. Instead of have a list of categories down the side of the page I would like to have a 5*2 grid of category images. Is this possible.

 

I hope that this is enough information for somebody to help me.

 

regards

Rob

Rob, that looks good to me. Regarding the categories, I would suggest either installing one of the category box contributions such as Dynamenu. I know there is one out there that will do EXACTLY what you are looking for.

Try the following search string in Google:

 

site:http://www.oscommerce.com/community/contributions category image


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

also in my admin i have

 

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_default.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_default.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main() [function.include]: Failed opening '/home/ardley/public_html/includes/languages/english/modules/sts/sts_default.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_index.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_index.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main() [function.include]: Failed opening '/home/ardley/public_html/includes/languages/english/modules/sts/sts_index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_popup_image.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_popup_image.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main() [function.include]: Failed opening '/home/ardley/public_html/includes/languages/english/modules/sts/sts_popup_image.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_product_info.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main(/home/ardley/public_html/includes/languages/english/modules/sts/sts_product_info.php) [function.main]: failed to open stream: No such file or directory in /home/ardley/public_html/admin/modules.php on line 140

Warning: main() [function.include]: Failed opening '/home/ardley/public_html/includes/languages/english/modules/sts/sts_product_info.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ardley/public_html/admin/modules.php on line 140

 

how can i solve this

Edited by ardley216

Ardley

Store:Gadget-Net

Share this post


Link to post
Share on other sites
Rob, that looks good to me. Regarding the categories, I would suggest either installing one of the category box contributions such as Dynamenu. I know there is one out there that will do EXACTLY what you are looking for.

Try the following search string in Google:

 

site:http://www.oscommerce.com/community/contributions category image

 

Bill,

 

Thank you for the feedback I have found something that I will definately be able to adapt.

 

In terms of the images missing - do you have any ideas. I think they might be in the wrong place but I don't know.

 

regards

Rob

Share this post


Link to post
Share on other sites
ok now im gwtting pissed off...

 

i put the original files back.. and now he errors wont go away

Looks like you either screwed up during the installation or you changed the default settings in the STS Default Module, or...your osCommerce is not a stock osCommerce shop and the folder structure is not compatible.

  1. Use a file comparison utility such as Winmerge or Beyond Compare to compare the files in the STS contribution with your shops files on the server.
  2. Change the STS Default Module settings back to the way they were originally. See the STS Installation HTML page for the default settings.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Bill,

 

Thank you for the feedback I have found something that I will definately be able to adapt.

 

In terms of the images missing - do you have any ideas. I think they might be in the wrong place but I don't know.

 

regards

Rob

Rob, I really do not fully understand what you are asking regarding the images. Post a link to your shop and I will take a look to see what you may be experiencing.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

thank you bkellum, but i think i might not bother.. easier that way.. i dont think you saw what was wrong though... i uploaded my backup files again..

 

but thank you


Ardley

Store:Gadget-Net

Share this post


Link to post
Share on other sites

Hello, I have a problem with the products template

 

When I click on the buttons that are in the right side of the page "$categorybox" it takes me to a page that shows me the product (it is correct) but the template that it is using is the one that in index.php.html. I want it to use a different template that I will create. Do you know where can I change the default template?

 

SXM :thumbsup:

Share this post


Link to post
Share on other sites
Hello, I have a problem with the products template

 

When I click on the buttons that are in the right side of the page "$categorybox" it takes me to a page that shows me the product (it is correct) but the template that it is using is the one that in index.php.html. I want it to use a different template that I will create. Do you know where can I change the default template?

 

SXM :thumbsup:

I don't think you actually have a problem with your product template except that you are not following the proper naming structure.

 

If all that you want to use for your site is one template, then you should just use the default template and then define that template in the STS Default Module within the admin.

 

However, that is not the way to get the most out of STS. STS allows you to have a specific template for any page and if a specific template has not been created, then the default template would be used.

 

For example, if you wanted a template just for the home page, you would create the template and then name it index.php_0.html.

 

If you wanted a single template to be used for all of the category pages, but different from the home page template, then you would just create another template and name it index.php.html. This would be the default template to be used in all of the category pages unless a specific category page template was created. In that case, the specific category template would be used for that category, and all other categories would use the index.php.html template.

 

The same goes for the product template. Their are two kinds of product templates; product page and the product info content portion only (the stuff in the $content tag for the product_info.php script).

 

:thumbsup: The STS User Manual goes into greater detail on the above.

 

Hope this helped,

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×