hi,
i want to insert a code or text that will be visible only on the index.
i would have to insert it on the /html/footer.php for proper layout.
thank you.
hi david,
i am thinking more like an IF statement,
if the file is index.php then print this.. something like that :)
i have an include that needs to be on the top right navigation bar but my given my existing template, that is not possible.
if this is not possible, its OK. :)
cheers,
oisin
Sure, you can do that - you need to look at the $_SERVER["PHP_SELF"] variable (assuming that it is set on your system) and make your code - or another include - conditional based upon it, so you could add something like this to footer.php.
You can also create a new file called user_footer_before.php if you want to be able to re-install Price Tapestry without losing your changes...
if ($_SERVER["PHP_SELF"] == "index.php")
{
// footer code for index page here
}
Cheers,
David.
hi david,
i tried this code but it doesnt seem to work.
<?php
if ($_SERVER["PHP_SELF"] == "../index.php")
{
print "some text here";
}
?>
the code may be wrong, am no PHP wizard :)
Hiya,
The thing to do is to print out the value of $_SERVER["PHP_SELF"] just to make sure exactly what you need to put in the test, for example:
<?php
print $_SERVER["PHP_SELF"];
?>
That should help...
Cheers,
David.
Hi there,
The best thing to do in this situation would be to edit index.php directly, as the file in /html/footer.php is included on every page.
The index.php in the distribution is intended as a starting point anyway, so you are perfectly safe to modify it as much as you want.
Cheers!
David.