#native_company# #native_desc#

default title

By Dan
on November 8, 2001

After I learned of the ease with which I could use PHP to incorporate a template into my website I had to figure out how to make the title not be default in all my pages. Sure, there’s lots of site-building template packages that’ll do this but when I first learned PHP I didn’t know that (also I’m a control-freak and not truly happy unless I’ve designed the whole thing myself:)

This is actually my first ‘snippet’. Put this in the template (you figure out where it goes;)

   <? if ($TITLE == '') {print "DEFAULT TITLE SUITABLE FOR ANY PAGE";} else {print "$TITLE";}?>

.. then on any page that you don’t want the default title to appear put


Maybe that’s pretty obvious, maybe everybody else is already doing that but it seems to me that I invented it and that makes me happy (please don’t tell me otherwise:)