PDA

View Full Version : Header Template


Feckie (Roger)
03-29-2007, 05:55 PM
Is it possible to have a header.php file and call it in the header template.

if so what would I put in the Header Temolate to call it

WetWired
03-29-2007, 06:27 PM
No, it is not, though you could add a plugin that runs at global start and puts stuff in a variable which is later used in the header template.

Feckie (Roger)
03-29-2007, 07:16 PM
No, it is not, though you could add a plugin that runs at global start and puts stuff in a variable which is later used in the header template.

Yep and now you have lost me ...........he he

WetWired
03-29-2007, 08:46 PM
Okay, right now you have a header.php file which, I assume, outputs interesting stuff using echo.
You need to make a copy of it that starts with
$headerphpout='';
(after the <?php, of course), then replace each instance of echo with
$headerphpout.=
This will put everything that it used to output directly into a string.

Next, go into Plugin System|Manage Products and click [Add/Import Product]. Fill out the bottom form and click save. (Example:feckie01,Special Header,1,My special header output)

Now, click Add New Plugin on the left. Select the name you just gave your product, then global_start. Give a title, then paste your modified header.php into the large box, select yes, then click save.

After that, add $headerphpout where you wanted to include header.php originally.

Be warned, however, that errors in global_start plugins seem to get hidden, so if there's a problem, your code will fail silently.

Feckie (Roger)
03-30-2007, 03:55 PM
Thanks will try this over the weekend