Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    616
    Thanks
    48
    Thanked 65 Times in 65 Posts

    How do you template your website?

    Out of curiosity, I'd like to take a little bit of a poll. How do you template your website? Do you:
    -Build each HTML page individually and include only template content (e.g. css, header, footer, etc.)?
    -Generate the entirety of the page content automatically (e.g. as a class) with unique page content included on each page?
    -Run the entire site from a single page (or several pages) with content determined by GET variables?

    I've been using the first option since I learned what an include was, but I've been leaning towards switching to something else for my next site to avoid having to manually correlate all the standard HTML tags page to page (even if they rarely change). Also, for those generating their pages, what is your preferred method? Including the content from php pages? XML pages? Databases?
    "Yeah science!"
    Online Science Tools

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,695
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Being primarily a front-end developer I’m usually building the HTML templates and then replace the recurring items with includes. So I basically have a file for each page and includes for the document header (i. e. doctype and everything that’s in the HTML <head> section), page header (i. e. logo, page title, main navigation – with navigation in yet another include), and footer. All the other methods you mentioned has been too much of a programming effort for my simple mind so far.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I ran my own system forever, but starting fairly recently I've decided that I need to focus more on getting what I have to do done and not nit-picking my template system. Instead, I've interfaced my existing software into one I've taken a shining to called twig. When I have more time available, I will likely continue on a new version of my own to replace the twig with since the changes will be minimal.
    I effectively create groups of "stuff" together in single files, and call them like includes. Even without twig I've always used a central point of access on the index file, and use querystrings (rewrite is optional) to determine what to do. Single entry is a must for the systems I've developed since I need to use the process management utilities with the interceptor to determine what to do, where to go, and how to filter it. Runtime control > structural control albeit at the cost of rigid error enforcement.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    .net master pages (which you can nest)- they make life so simple

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #5
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    616
    Thanks
    48
    Thanked 65 Times in 65 Posts
    Lots of variety so far. Including the recurring content always leaves me with a sort of disorganized feeling whenever I edit the pages, similar to near the end of each quarter when I notice that my room has become cluttered with books and dirty clothes and loos papers everywhere. I guess this might not be the most logical way to feel, but it bothers me nonetheless. Query strings seem like the way to go this time around, since this will be a content submission based site. I've never been one to use third party code. I'm a hobbyist, so coding for me has always been more of an end than a means.

    Anyway, thanks for the replies. I was reading a forum post recently that involved a conversation between music teachers about having to unteach bad habits picked up by self-taught musicians and today I sort of connected that to coding.
    "Yeah science!"
    Online Science Tools


  •  

    Posting Permissions

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