Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Including other pages


Guest

Recommended Posts

I have a large site, that uses three php pages, that are included using a php include on every page. Is there anyway to include these in the STS template system?

 

<?php include 'url-to-file';

?>

Edited by zmoos
Link to comment
Share on other sites

I have a large site, that uses three php pages, that are included using a php include on every page.  Is there anyway to include these in the STS template system?

 

<?php include 'url-to-file';

?>

 

 

I think I changed my sts_template.html to sts_template.php in includes/configure.php . I think that will allow you to use includes on the template now because the extension of the template file is now php.

 

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html);

 

to

 

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.php');

If im totally wrong please correct me.

Edited by InfamousDC2
Link to comment
Share on other sites

I think I changed my sts_template.html to sts_template.php in includes/configure.php . I think that will allow you to use includes on the template now because the extension of the template file is now php.

 

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html);

 

to

 

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.php');

If im totally wrong please correct me.

 

 

I did try that, and it didn't seem to work. Is there ANY way to include additional files in the to template?

 

Zach

Link to comment
Share on other sites

I did try that, and it didn't seem to work.  Is there ANY way to include additional files in the to template?

 

Zach

 

I don't think there is as the template in STS is only parsed for items that have been defined.

 

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

 

The template isn't really doing straight php. It's really just a wrapper around pieces of osC which is why it's so easy to move stuff around.

 

What you COULD do (emphasis on could, I haven't tried) is define your include file as a new template tag and see if you can get the wrapper to recognize and write it into the info it passes back to php/apache.

 

"If you want to include new features to your code, you will need to create new template variables in sts_display_output.php, sts_product_info.php or sts_user_code.php. You can then put your new template variables wherever you like in the template file(s)."

 

Check out the STS site and the official thread here on the boards (see the README). The thread is a little like being on the Bataan Death March at this point but there's lots of good info in there for those willing to dig.

 

Hope that helps!

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Thanks Iggy,

 

I think that might be possible, because I was able to fo an include in footer.php, which has a variable in the template, and that seemed to work. So I will work on trying to create new variables and see if that does it.

 

Zach

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