I want to add breadcrumbs to my site and came across this code. As I use php includes for my header, left nav and footer this fits really well
-----------------------------------------------------------------
Method One:
<?
if (isset($folder) && !isset($folder2)) {
echo "<a href=\"/\">Home</a> > <a href=\"./\">$folder</a>";
}
if (isset($folder) && isset($page) && isset($folder2)) {
echo "<a href=\"/\">Home</a> > <a href=\"../\">$folder</a> > <a href=\"./\">$folder2</a>";
}
?>
With this method, you enter this entire code within your header.php file, then in each page add the folder variables:
<?
$folder = 'Internet Marketing';
$folder2 = 'SEO';
include('header.php');
?>
For each extra layer you must add additional code, just follow the same procedure as the above code has and it will work.
----------------------------------------------------------------
My problem is it doesn't seem to work! I put the code that goes in the header, the actual display code, in an html block in the header and added the $folder definitions to the include html block in the page.
Can anyone help and figure either why this doesn't work or what I've done wrong.
Appreciated, Thanks
-----------------------------------------------------------------
Method One:
<?
if (isset($folder) && !isset($folder2)) {
echo "<a href=\"/\">Home</a> > <a href=\"./\">$folder</a>";
}
if (isset($folder) && isset($page) && isset($folder2)) {
echo "<a href=\"/\">Home</a> > <a href=\"../\">$folder</a> > <a href=\"./\">$folder2</a>";
}
?>
With this method, you enter this entire code within your header.php file, then in each page add the folder variables:
<?
$folder = 'Internet Marketing';
$folder2 = 'SEO';
include('header.php');
?>
For each extra layer you must add additional code, just follow the same procedure as the above code has and it will work.
----------------------------------------------------------------
My problem is it doesn't seem to work! I put the code that goes in the header, the actual display code, in an html block in the header and added the $folder definitions to the include html block in the page.
Can anyone help and figure either why this doesn't work or what I've done wrong.
Appreciated, Thanks
Comment