Hi I have just purchased this script, very pleased so far.
This script is going to run in a new directory of my websit. I wouold like to include the header and footer from my existing website and call it with an include or require function. My site is written in php so im hoping this is easy.
For each page I currently used
include ( PATH . '/templates/' . $cookie_template . '/header.php' );
and
include ( PATH . '/templates/' . $cookie_template . '/footer.php' );
I know I could just paste the code in the html/ files but it would be great to be able to do it this way.
How should I go about this,
in your index.php theres
require("html/header.php");
Should I change this to
require("locatiof of my existing header.php");
I am abit worried there may be problems as this script is in a different directory. Thanks in advance!
Thanks for the quick reply David,
Ah, the problem is my header and footer doesn't include pure html. It also includes php and some include functions also. Such as
<?php include ( PATH . '/templates/' . $cookie_template . '/tables.php');
Which has functions so when I write pages I can write code:
echo table_header ('title');
echo 'text goes here';
echo table_footer ();
Is this a big no no or can something be done?
Thanks very much :-).
Hi Steve,
That should be fine - perhaps the easiest thing to do is start by just including them directly and see how it turns out (use View > Source to study the HTML); and then take it from there... It it doesn't turn out as expected feel free to email me a link to the site and i'll look at the source and suggest what to do (I can tell from the source what is being generated by your existing header / footer and what is Price Tapestry generated)... Reply to your reg code or forum registration email is the easiest way to get me...
Cheers,
David.
Hi Steve,
If your include files contains pure HTML (i.e. they do not contain the <html> part of the page) then you can include them by creating 2 new files in your Price Tapestry html/ directory:
user_header_after.php
<?php
require("location of my existing header.php");
?>
...and
user_footer_before.php
<?php
require("location of my existing footer.php");
?>
That should do the trick...
Remember that all references to other resources (css, images etc.) within your custom header and footer should be absolute so that they will work OK anywhere within the Price Tapestry folder and virtual directory structure if you are using search engine friendly URLs ($config_useRewrite = true)...
Cheers,
David.