NYCPHP Meetup

NYPHP.org

Templating and design strategies

Mike Myers myersm at optonline.net
Wed Sep 4 16:13:03 EDT 2002


What are some good ways to manage hierarchical templates when using
Apache/MySQL/PHP?

I am accustomed to Frontier's approach, where a site and its sub-directories
are contained within a hierarchical object database. This made it very
natural to have layout and boilerplate items which apply selectively,
depending upon where a given web page exists in the hierarchy, or what
server directives are present. Conditionally grabbing something from the
object database was very easy to do. The bulk of the page rendering involved
replacement of placeholder strings with database values.

OTOH, I felt cramped using Frontier, because I had often had to figure out
how to work within the framework to achieve customized effects.

Using MySQL to store such components seems like overkill. Do most php
developers use a file-based strategy coupled with include, require, or
fileio methods.?

Another option is Dreamweaver MX, which has a template framework. It seems
to have a crude system for conditional components ('optional region'). I
have experimented a bit with Dreamweaver's web application framework for
PHP/MySQL, and my first inclination is to NOT become overly dependent on the
Dreamweaver way of doing things. Moving data from a MySQL table into a basic
HTML table is easy, but doing things that break the simple mold might get
cumbersome. Granted, I've only tinkered with it for a few days.

Are there some "common practices" out there, or perhaps website frameworks
for PHP that don't have a 6 month learning curve?

Basic Example:

The layout of the info flowing through the different "topics" below is
roughly similar. But the specific navigation bars, jump menus, and other
elements of the page margins are specific to each topic. The customized
aspects could be in a database or defined within preference files located at
various levels of the site.

  site
    topic_1
       category_1
       category_2
       category_3
    topic_2
       category_1
       category_2
   
Not such a great example, I hope people get my point.




More information about the talk mailing list