- Impact
- 0
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
http://namepros.com/code/307704-php-template-system-class.html
http://namepros.com/code/189417-php-template-system-php4-5-a.html
http://www.namepros.com/code/120978-php-template-script.html
Most of these examples use something like (taken from BillyConnite's example):
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:
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!!!
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
http://namepros.com/code/307704-php-template-system-class.html
http://namepros.com/code/189417-php-template-system-php4-5-a.html
http://www.namepros.com/code/120978-php-template-script.html
Most of these examples use something like (taken from BillyConnite's example):
PHP:
<?php
require_once('template.class.php');
$tpl = new Page('design.html');
$tpl->replace_tags(array(
'title' => 'This is the title of my html page',
'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!!!