alex198555 0 Report post Posted November 20, 2009 Hey, guys. I am building my own PHP Content Management System. There is a question for all of you. How can I make templates and apply it to my web-site. For instance, I want that borders, colors or the location will be changed when the template is applied. I want that it can be done by a user and admin can do it as well for admin center, let's say. If you have a link to a nice tutorial, please post. Share this post Link to post Share on other sites
legend112 0 Report post Posted November 20, 2009 Hey, guys. I am building my own PHP Content Management System. There is a question for all of you. How can I make templates and apply it to my web-site. For instance, I want that borders, colors or the location will be changed when the template is applied. I want that it can be done by a user and admin can do it as well for admin center, let's say. If you have a link to a nice tutorial, please post. a template in php can easily be structured by html code. The other things that will fit in can be taken from the variable which you specify so its very easy, for example: -you can have an html page with the following: <html>Your name is: <?php echo $username; ?><br />And you live in: <?php echo $location; ?></html> Thats the easiest i could come up with...as you can see its very basic and the idea is that the user's info will change depending with his/her information. for want you want to happen, to change borders and everything, its a small matter of doing something similar to: <table border="<?php if($layout == 'yellow') echo 1px yellow solid ?>"> of course that depends with your structure and how you want to switch between the values. I hope you got the logic, if you had more info i'd be happy to help. Cheers Share this post Link to post Share on other sites
truefusion 3 Report post Posted November 20, 2009 Do some research on model view controller (MVC). Many, if not most, template systems run off of this principle. Much of the content that the template will contain when sent to the browser will always be the same no matter which template is used. Therefore the template system requires access to functions or keywords that retrieves data for to be inserted in their appropriate places. Share this post Link to post Share on other sites
rubikcode 0 Report post Posted December 7, 2009 Adding on to what is said, you should add an INFO file or something for each template and store certain variables in a database.Of course in more sophisticated CMSes Pure HTML isn't used but generated GIF/PNG border images. Share this post Link to post Share on other sites