ipwnzphp Posted January 22, 2007 Share Posted January 22, 2007 Hello, I'am coding a template system and i have an idea of what i want it to do. I have the basics down where i have a main.php page and i use {header} {footer} and such to layout the pages to put the content where i want it. But the question is OS Commerce has a thing called STS Templates and u use 1 page to theme the whole site. u put $content where you want the content and it shows every sub page with content right there. How can i get my system im coding to do that also? Much help well be very appreciated! ;D Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/ Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 On your main.php page wherever you want your content, just put that var.so if you have a header.php and footer.php it sounds like you do this:<?require_once('header.php');$content;require_once('footer.php');?>You should check the support forums for the software though, they likely have documentation for it. Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166325 Share on other sites More sharing options...
obsidian Posted January 22, 2007 Share Posted January 22, 2007 As for another approach to the templating question: check out the API and documentation for [url=http://smarty.php.net]PHP Smarty[/url], and you'll get an idea of it, too. Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166329 Share on other sites More sharing options...
ipwnzphp Posted January 22, 2007 Author Share Posted January 22, 2007 Well see.. what would the code be for the $content ? A array or what? Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166434 Share on other sites More sharing options...
redbullmarky Posted January 22, 2007 Share Posted January 22, 2007 no. content would be your fully parsed HTML for the sub-page - so effectively just a string. Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166436 Share on other sites More sharing options...
ipwnzphp Posted January 22, 2007 Author Share Posted January 22, 2007 So i would need to do some replace tags code? Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166437 Share on other sites More sharing options...
redbullmarky Posted January 22, 2007 Share Posted January 22, 2007 maybe at this stage it'd be better to follow obsidians advice and look through Smarty (as well as templates such as bTemplate, phpSavant, etc) to see how they work. Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166439 Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 [quote author=redbullmarky link=topic=123503.msg510612#msg510612 date=1169482176]maybe at this stage it'd be better to follow obsidians advice and look through Smarty (as well as templates such as bTemplate, phpSavant, etc) to see how they work.[/quote]Or read the OS Commerce documentation, or check out their forum. Instead of looking at another template system which would just confuse you, I'd think it'd make more sense to read about the one you're using... Quote Link to comment https://forums.phpfreaks.com/topic/35223-template-system-help/#findComment-166444 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.