Page 1 of 1

Are relocatable header and footers possible?

Posted: Fri Aug 17, 2007 1:13 pm
by gildionne
/*************************************
Title:gbook
Version:1.5
Short description: allow header and footer to be relocatable

*************************************/
Presently, I am changing my site to use dynamic page generation, and use an 'include' to add the header and footer. Unfortunately, I must keep a second copy of these two files in the gbook directory as gbook expects these files to be found there.

Would it be possible to change gbook so that the location of these files could each be entered into the 'settings.php' file? It could be shipped with the settings prefilled with the default locations in the gbook directory, but would allow a user, who is more familiar with relative addressing to change it to a different location. Then any changes to the sites header and footer would reflect over all the pages, even gbook.

The alternative requires me to rewrite printDownHTML() and add an additional 13 lines of code, throwing the line numbers out of sync with possible future fixes.

Gil

Posted: Fri Aug 17, 2007 2:58 pm
by gildionne
Re: Are relocatable header and footers possible?

I am replying to my own message rather than editing it.
I have thought about my previous request about relocatable header and footer and came to a sad conclusion.
Both my header and footer sections contain links to images and other files.

My entry page (index.php) is parsed at the top level of my site, but gbook.php is parsed one level LOWER. Using relative addressing TO or IN a header (or footer) will not work as the levels are not the same. One rendering or the other would find some files missing.

This could be corrected by using absolute addressing. But then I would lose the ability to edit all of my pages while off-line, using my site mirror on my hard drive. My internal apache server is not setup exactly as my ISP's server and there is an extra level on my local server. I can't seem to work around it. The result though, is that it would prevent me from seeing the pages the same way as they are displayed on the web.

I guess that I will have to live with that duplication.

Gil

Re: Are relocatable header and footers possible?

Posted: Mon Nov 12, 2007 11:36 pm
by tonywalton
I don't know what platform you're on, but if it's Unix-oid (including Mac OS X, where you could do the same thing with Finder by creating an alias) have you considered symlinks? Maybe Windows has a similar "aliasing" function, but I've managed to avoid knowing anything at all about Windows for 20 years! :lol: