JamesGMills
Programmer
Hi i have been told about smarty for a problem i am having:
Original problem----------------------------------
A long time ago i used to make all my pages in html and make a new page full of new code for each page needed.
Then i found dreamweaver templates and fell in love...
Then i found the use of php includes... WOW how much easier this made life.
However one problem i have found recenly is this:
If you have an include for a header and a footer and then for every page you put your content inbetween these included files it works a treat. However then the header file is going to be the same for every page thus making your title the same for every page!
There is one way i was thinking of... having a header_part1.php and a header_part2.php and then you could add te title inbetween these and you could change the title for each page individually...
How do you lot do this or get around the issue of having a different title for all your main pages.
If i was using my CMS i would just specify the title for the page/section in te database and it would load this dynamically but not always that practical....
-----------------------------------
I have been told i can use it like this:
However where and how do i include the smarty class because i have downloaded the "Smarty.class.php" file and included it but i can not get the above code to work?
Thanks for help in advance.
Original problem----------------------------------
A long time ago i used to make all my pages in html and make a new page full of new code for each page needed.
Then i found dreamweaver templates and fell in love...
Then i found the use of php includes... WOW how much easier this made life.
However one problem i have found recenly is this:
If you have an include for a header and a footer and then for every page you put your content inbetween these included files it works a treat. However then the header file is going to be the same for every page thus making your title the same for every page!
There is one way i was thinking of... having a header_part1.php and a header_part2.php and then you could add te title inbetween these and you could change the title for each page individually...
How do you lot do this or get around the issue of having a different title for all your main pages.
If i was using my CMS i would just specify the title for the page/section in te database and it would load this dynamically but not always that practical....
-----------------------------------
I have been told i can use it like this:
Code:
$header = "includes/header.php";
$title = "James Mills Personal Website Contact Page";
{include file=$header title='$title'}
However where and how do i include the smarty class because i have downloaded the "Smarty.class.php" file and included it but i can not get the above code to work?
Thanks for help in advance.