CSS-Tricks PSD to HTML: You Design - We XHTML

New Screencast: Working Modularly With PHP

Many sites do not use any fancy Content Managment System (CMS) to generate their pages, they are just just good ol’ static HTML content. A site for your grandmothers pie baking business probably only has a few pages, perhaps a homepage, about page, and contact page. Each of these pages has different main content, but much of it stays exactly the same, like the header, navigation, and footer. Think of these sections as “modules” that you can easily use PHP to insert into the page. This way, making changes to those sections changes all the pages at the same time, saving you time and potentially mistakes. At the end, I show you how you can still achieve unique effects in your navigation despite the code being identical.

screencast-11-thumb.jpg


Theoretically Related Articles:


Responses


  1. 1

    Gravatar

    I always thought using templates in Dreanweaver was the way to go until I decided to try this PHP technique when building http://www.stephanietabram.com.au. I’m a convert!


    Comment by Graham Bannister — March 28, 2008 @ 12:20 pm

  2. 2

    Gravatar

    nice tutorial, can you tell where i can download your editor, this one is cool to but on http://www.mediatemple.net i can’t find a download link or something like this, thanx


    Comment by Daniel — March 29, 2008 @ 10:53 pm

  3. 3

    Gravatar

    @ daniel:

    http://www.panic.com/coda/


    Comment by V1 — March 30, 2008 @ 2:43 am

  4. 4

    Gravatar

    Thank you


    Comment by Daniel — March 30, 2008 @ 5:24 am

  5. 5

    Gravatar

    Thanks for the new video, looking forward to seeing it. Keep it up ;)


    Comment by Tobey — March 31, 2008 @ 3:51 am

  6. 6

    Gravatar

    Good tutorial, but I prefer using only one php-file instead of three…

    Just take a look at this.
    (ed. I posted this on a page for easier viewing -Chris)

    P.S. I know that this is not perfect php-code, but I tried to keep it simple so everybody can understand the idea of putting three pages in only one php-file.


    Comment by Edwin — March 31, 2008 @ 6:48 pm

  7. 7

    Gravatar

    Yes, the tutorial is very helpful for me, too. Than’s for your work and sharing.

    Ralph


    Comment by Ralph — April 5, 2008 @ 2:16 pm


Leave a comment

Sick of typing in all this info everytime you comment? Register or Login and save yourself time!

LINKS: You can use <a href="">LINK</a> tags here.
CODE SAMPLES: Please wrap code samples in BOTH <pre> and <code> tags.

Thank you for visiting CSS-Tricks! I'm glad you found an article useful enough to print out! Remember to visit css-tricks.com often for more fresh content.