Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi,I'm newbie, I' doing my first template with STS, I've customized the homepage with new graphics,

the only thing that doesn't work is the content box ( New Products For October )

that is very small on the left and I want instead it to be 300px centred, can you help me to personalize the main content box? where??

I didnt find in the css the width of the box, the align center,

 

it's the box from infobox.php.html, i'd like to use onother box from another file becouse it is too small, how can I do??

 

and I want to eliminate the text:

 

What's New Here? What's New Here?

Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?

Welcome this is your most exiting shopping trip! enjoy!

 

can you help me?? thank you!!

Posted

I've found in classes/boxes.php

the code to call the right file in the sts template for the boxes in the homepage

 

  $template = sts_read_template_file (STS_TEMPLATE_DIR."boxes/infobox.php.html");
		$sts->infobox['default_content'] = $template;

 

from the infoBoxTemplate function inside the class tableBox

 

function infoBoxTemplate($content) {
// STS 4.3: read content, display header & content.
// STS 4.4: reset headertext and right_arrow variables in case next box has no header.
  global $sts;
	$btrace=debug_backtrace();
	$boxname=basename($btrace[1]['file'],".php"); // backtrace 1 is the calling file
	$boxprefix = "infobox_"; // Added in v4.3SP2.

	// Added in v4.4: allows to use catalog_filename.html as template for boxes created directly in a catalog script.
	$boxname2 = basename($btrace[2]['file'],".php"); // backtrace 2 is the file calling the calling file (like sts_column_left.php)
   if ($boxname2=='') $boxprefix = "catalog_";

  if (file_exists(STS_TEMPLATE_DIR."boxes/$boxprefix$boxname.php.html")) {
		$template=sts_read_template_file (STS_TEMPLATE_DIR."boxes/$boxprefix$boxname.php.html");
	} elseif (isset($sts->infobox['default_content'])) {
	  $template = $sts->infobox['default_content']; // Default box already in memory, get it from there
	} else { // Otherwise read it from file and save it
////////////////////////////////////////////
///////////////////////////////////////////
	  $template = sts_read_template_file (STS_TEMPLATE_DIR."boxes/infobox.php.html");
		$sts->infobox['default_content'] = $template;
////////////////////////////////////////////
/////////////////////////////////////////////			
	}

	$template = $sts->infobox_header_template."\n".$template;	// Add header before the content. Header can be empty.
	$template = str_replace('$headertext', $sts->infobox_headertext, $template);
	$template = str_replace('$right_arrow', $sts->infobox_right_arrow, $template);
	$template = str_replace('$content', $content, $template);

	echo $template;
	$sts->infobox_header_template = '';
	$sts->infobox_headertext = '';
	$sts->infobox_right_arrow = '';
}
 } // END tableBox class

 

and the modules/new products.php call the box from infobox.php.html of sts template with this code:

 

new contentBox($info_box_contents);

 

if I add in classes/boxes.php:

class plainBox extends tableBox {
function plainBox($contents) {
	$this->table_data_parameters = 'class="plainBox"';
	$this->tableBox($contents, true);
}
 }

 

and i change

 //new contentBox($info_box_contents);
 new plainBox($info_box_contents); 

 

there's no more the same box but there's no box at all, only the products

 

I'd like to load the new products box from another file

 

  $template = sts_read_template_file (STS_TEMPLATE_DIR."boxes/another-infobox.php.html");
		$sts->infobox['default_content'] = $template;

 

I don't know how to set 2 box files in the classes/boxes.php

 

how can I add 2 source files for different boxes in the classes/boxes.php ???

 

do you know?? can you help me??

thank you!!

  • 4 weeks later...
Posted

resolved: it's enough fo add a file called infobox_new_products.php.html with the code of the new box, without changing a line of code.... bye!!

 

 

You would have gotten a quick response if you had posted in the correct forum.

 

thumbsup.gif Please post all STS related support questions in the STSv4 Support Forum (link is in my signature below as well as listed in the STS User Manual).

Bill Kellum

 

Sounds Good Productions

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...