I am trying to design a templating system which uses the standard header, footer a site-wide left nav bar and a section specific right nav bar.
The page.php page template looks like this:
<? require ("/usr/local/apache/htdocs/iwww/inc/init.inc"); ?>
<? include ("inc/header.inc"); ?>
<? include ("inc/left_nav.inc"); ?>
<? include ("$c.php"); ?>
<? include ("inc/$rightbar"); ?>
<? include ("inc/footer.inc"); ?>
The init.inc page has a block of code that tests for the $section variable and assigns a value for $rightbar. That all.
The $c page(s) contain the content for each page. At the top of each $c page, I am declaring several variables ($section, $page_title) which correspond to what type of right nav bar should be displayed for this page.
All goes well until the <? include ("inc/$rightbar"); ?> is encountered. Obviously (at least to me) this variable is not yet available to the init.inc script to set the value of $rightbar. So I get "flex scanner" errors.
So my question is how can I grab the variables set on the $c page before it is included, so I can set up how the eventual page is built?
Many thanks.
-- Guyle