Announcement

Collapse
No announcement yet.

Breadcrumbs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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>
    Regards Chris.

    Collectables, Collecting, collectors-info.com

    www.chrismorris.co.uk

    House build project

    Comment


    • #3
      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

      Comment


      • #4
        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.
        Regards Chris.

        Collectables, Collecting, collectors-info.com

        www.chrismorris.co.uk

        House build project

        Comment

        Working...
        X