Ever since i first began working with the basic template i (poorly) describe elsewhere here in this journal, i have been trying different things to perfect it. Today, I made a small breakthrough.
As can be seen at one of my experimental web sites, A Design Interactive, I have been using a singular output file, the content of which changes by way of values sent through the HTTP GET header. For example, my nav menu code might look like:
<li><a href="file.php?bodyid=home">Home</a></li>
, where the “bodyid” value tells the PHP what HTML code to use for the page output display. For example, that _GET[bodyid]
value might control an SQL statement for pulling data from a database, or it might control values of simple string variables held in a flat file, in the inc
folder perhaps.
The point here however is that i’ve determined that my web sites might be ultimately better if i don’t try to use the singular file, but use a more traditional method where, for example, that value of _GET[bodyid], as in the example above where “home” was used, the target file would be named home.php
(or index.php– meaning– the value and the page-name don’t have to be equivalent, but it is the most logical approach)
Combining this method with that of my previous technique, opens up a world of possibilities where much dynamic data can be used w/out cluttering your folders with more files than you need.
The key to success with this technique, from what i’ve learned so far, is planning. How many pages are needed. Among those, how many distinctly different pages are needed? Use the distinct pages for those which will have the distinct names so it is easier to control their unique content / style structures, and for the others– don’t change the page name if you don’t have to.
NOTE: Remember this is a work in progress for me– i do not guarantee that any of this is the best practice, or a good idea — but so far, my folder structure has been much easier to maintain– with only a few different files in the root, and the /inc/ folder, it makes FTP management, among many other processes much easier to handle.
Leave a Reply