SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    BASIC PHP Template using SSI?

    How do I make a php template that controls variables for every page that uses it?

    Example: Global Artist Profile Template

    <% Name %> <br/>
    <% Picture %> <br/>
    <% Bio %> <br/>
    <% Audio %> <br/>
    <% Lyrics %> <br/>
    <% External Links %> <br/>
    <% Artist Page Ad %> <br/>

    -----Becomes-----

    MC Tech
    This guy is blah blah...
    Song 1, Song 2...
    Lyric 1, Lyric 2...
    www.link1.com, www.link2.com
    "Buy CDs from amazon.com!"

    I need to be able to add <% Videos%> for example down the road to the global template and it effects every page that uses it.

    A. How do you do this?

    B. Do I have to store the data in a mySQL database?

    Thanks.

  2. #2
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this should be simple...

  3. #3
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just use include files (google PHP + includes).
    You can make a template consisting of include files and in those files you can have database queries if you want, since php in includes are executed.
    I hope this helps.

    Quote Originally Posted by insan99
    How do I make a php template that controls variables for every page that uses it?

    Example: Global Artist Profile Template

    <% Name %> <br/>
    <% Picture %> <br/>
    <% Bio %> <br/>
    <% Audio %> <br/>
    <% Lyrics %> <br/>
    <% External Links %> <br/>
    <% Artist Page Ad %> <br/>

    -----Becomes-----

    MC Tech
    This guy is blah blah...
    Song 1, Song 2...
    Lyric 1, Lyric 2...
    www.link1.com, www.link2.com
    "Buy CDs from amazon.com!"

    I need to be able to add <% Videos%> for example down the road to the global template and it effects every page that uses it.

    A. How do you do this?

    B. Do I have to store the data in a mySQL database?

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •