Results 1 to 4 of 4

Thread: Breadcrumbs
      
   

  1. #1
    Winntec's Avatar
    Winntec is offline First Sergeant
    Join Date
    Nov 2006
    Location
    Sandy Point, Nova Scotia, Canada
    Posts
    72

    Default Breadcrumbs

    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
    CedarAtticVents.com Genuine Cedar Attic Vents, Gable Vents and Shutters in many Standard Designs and Sizes as well as Custom Made to Your Specifications
    HingeAndLatch.com Gate and Door Hardware with the look and feel of yesteryear. Traditional and Antique styles to enhance all your entrance-ways


  2. #2
    Join Date
    Feb 2006
    Location
    Earth
    Posts
    8,721

    Default Re: Breadcrumbs

    Not sure on the one above. But this one is worth a look. Just paste it in a html box, & thats it.

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    //Bread crumb script - Kevin Lynn Brown
    //Duplicate directory names bug fix by JavaScriptKit.com
    //Visit JavaScript Kit (http://javascriptkit.com) for script

    var path = "";
    var href = document.location.href;
    var s = href.split("/");
    for (var i=2;i<(s.length-1);i++) {
    path+="<A HREF=\""+href.substring(0,href.indexOf("/"+s[i])+s[i].length+1)+"/\">"+s[i]+"</A> / ";
    }
    i=s.length-1;
    path+="<A HREF=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\">"+s[i]+"</A>";
    var url = window.location.protocol + "//" + path;
    document.writeln(url);
    //-->
    </script>

  3. #3
    Winntec's Avatar
    Winntec is offline First Sergeant
    Join Date
    Nov 2006
    Location
    Sandy Point, Nova Scotia, Canada
    Posts
    72

    Default Re: Breadcrumbs

    Chris
    Thanks - I've tried a few like this but they take the page names - what the one I put up in the post above uses page names you set yourself - it's semi-manual but means you have control over the breadcrumb names.

    Hey - London Borough of Barnet - way back when i lived in the UK I bought a TVR at John Britain Motors - he won't be there anymore but on the test drive he took it up to 100mph on the A1 - I bought it immediately - cost me 880pounds! Great car - what a blast!

    Best
    CedarAtticVents.com Genuine Cedar Attic Vents, Gable Vents and Shutters in many Standard Designs and Sizes as well as Custom Made to Your Specifications
    HingeAndLatch.com Gate and Door Hardware with the look and feel of yesteryear. Traditional and Antique styles to enhance all your entrance-ways


  4. #4
    Join Date
    Feb 2006
    Location
    Earth
    Posts
    8,721

    Default Re: Breadcrumbs

    Ah! the odd thing about it is there has been a TVR Centre/garage on Barnet lane, Arkley for as long as i can remember. But was recently changed to Trimar Sports cars, i wonder if this is the same garage be pass on down the years? Link to John britten

    At least it bumps the post back up for someone with a bit more php knowledge.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49