Guest Posted March 13, 2005 Share Posted March 13, 2005 (edited) 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 March 13, 2005 by zmoos Quote Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2005 Share Posted March 14, 2005 (edited) 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'; ?> <{POST_SNAPBACK}> 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 March 14, 2005 by InfamousDC2 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2005 Share Posted March 15, 2005 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. <{POST_SNAPBACK}> I did try that, and it didn't seem to work. Is there ANY way to include additional files in the to template? Zach Quote Link to comment Share on other sites More sharing options...
Iggy Posted March 15, 2005 Share Posted March 15, 2005 I did try that, and it didn't seem to work. Is there ANY way to include additional files in the to template? Zach <{POST_SNAPBACK}> 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 Quote Everything's funny but nothing's a joke... Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2005 Share Posted March 15, 2005 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.