NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page help with template systems

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search


Reply
 
LinkBack Thread Tools
Old 03-17-2009, 01:05 PM THREAD STARTER               #1 (permalink)
First Time Poster!
Join Date: Mar 2009
Posts: 1
mwalko09 is an unknown quantity at this point
 



Help! help with template systems


Hello everyone,

I've been researching template systems and found this site on google. I myself just got accustomed to linear programming style and have made a working cms using the include(''); method for template systems.

I have read 4 articles on this site and the ones @ codewalkers without much success. I can understand about 70% of the code and what it does but when it comes to displaying content from say the main "index" page to say the "about me" page I am getting confused.

BTW here are the articles I found:
http://namepros.com/code/443220-output-class-php5.html
????: NamePros.com http://www.namepros.com/code/567798-help-with-template-systems.html
http://namepros.com/code/307704-php-...tem-class.html
http://namepros.com/code/189417-php-...-php4-5-a.html
http://www.namepros.com/code/120978-...te-script.html

Most of these examples use something like (taken from BillyConnite's example):
PHP Code:
  <?php

require_once('template.class.php');

$tpl = new Page('design.html');
$tpl->replace_tags(array(
    
'title' => 'This is the title of my html page',
????: NamePros.com http://www.namepros.com/showthread.php?t=567798
    
'content' => 'Here\'s some content which I am putting inside the page, yaaay.'
));
$tpl->output();

?>
This uses 'content' =>'string' as the way to display the content... butwhat i don't understand is how would you split it up to link individual pages?

For instance:

I have a pre-made template with a header, left navbar, main content, and a footer. A basic CSS template. What I am wanting to do using this template system is have the template file as follows:
Code:
<html>
<head>
<title></title>
</head>
<body>

where the leftnavbar.php file, and the maincontent.php file would later be included but is empty because this is just the default template.

</body>
</html>
Then call the leftnavbar.php file, and the maincontent.php file as individual pages...

If i could figure that out I would have half of my problem resolved. The other half being how when the user clicks a link, goes to it and the template loads with the correct maincontent file...

If anyone could help me clear this up or direct me to somewhere that the whole process is explained. I would be really grateful!!!
mwalko09 is offline   Reply With Quote
Old 03-24-2009, 09:41 PM   #2 (permalink)
Senior Member
 
Dave's Avatar
Join Date: Jun 2007
Location: NamePros.com
Posts: 1,400
Dave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud ofDave has much to be proud of
 


Cancer

I would recommend checking out Swift Engine. Its very simple and easy to use and best of all its free.

http://swiftengine.com/

Trust me, its lightweight and the code is extremely easy to understand. Better yet its also an Internationalization engine all rolled into one (for supporting different languages in your templates automatically).

Regards,

Dave
Dave is offline   Reply With Quote
Old 03-24-2009, 10:30 PM   #3 (permalink)
NamePros Regular
 
eFingerz's Avatar
Join Date: Jan 2008
Location: Hell / Gulf Coast / South Louzyanna - - Bayou.me
Posts: 578
eFingerz is just really niceeFingerz is just really niceeFingerz is just really niceeFingerz is just really niceeFingerz is just really nice
 



Protect Our Planet
you can also try Smarty Template engine
http://www.smarty.net

Good Luck
PeAcE
__________________
MakeAoffer»YumPage.com,Hemp.im,SEOed.US, Ru01.com,NicheSites.US & lots more«|
«» Host XL «»Custom T-shirts «»
«»Turnkey PHP Web Scripts:«»
eFingerz is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:17 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger