Dynamic Breadcrumbs question

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Dynamic Breadcrumbs question

    Hi,
    I am trying to implement this dynamic breadcrumbs script:
    [url]http://www.macromedia.com/devnet/dreamweaver/articles/breadcrumbs.html[/url]

    The article above talks about creating a Macromedia extension to insert the
    breadcrumbs php. I am not interested in the extension aspect of this article,
    but rather in getting the php code that generates the breadcrumbs to work.

    What do I add to my html file for it to call the php script and make this
    thing work? Can anyone break it down for me in simple terms?

    I have looked on a lot of other websites for breadcrumb navigation code and
    there are several php script options, however no one explains step-by-step how
    to call it from your html file. I am building an intranet and our programmer
    just quit, so I'm rather up a creek without a paddle. My expertise is in
    navigation, design, html, etc. I have very little experience with php. Hate to
    be an ignoramous about what is probably painfully obvious to others, but any
    help someone could provide would be greatly appreciated.


    Tango21 Guest

  2. Similar Questions and Discussions

    1. Kaosweaver Breadcrumbs
      I have been using the Kaosweaver Breadcrumbs script on my new site which works great. The only problem is that when I validate the page for W3C...
    2. Breadcrumbs
      Could someone please give me some suggestions about including breadcrumbs, or something like, on a website. The site is static, and I do not have...
    3. Breadcrumbs?
      I'm trying to implement a breadcrumbs trail through my site and am using the code detailed below. This works fine but I have a couple of questions:...
    4. dynamic text question???
      is there a way to create dynamic text that remains anti-aliased? thanks > mark
    5. DYNAMIC SQL SELECTION QUESTION
      I posted a question earlier but that did not help me. I need to insert data from joined files A - B into C The tables are joined by the fields:...
  3. #2

    Default Re: Dynamic Breadcrumbs question

    call this php script with an include on any page which needs to show breadcrumb
    as such: <p><? include('/breadcrumbgen.php'); ?>

    // breadcrumbden.php
    <?
    /* PHP dynamic link bar script by Fran?ois Richardson. Free for use and abuse.
    Makes a series of links to the web root (printed as "Home"), each folder
    in the file path, and the filename. Underscores in the file names and folder
    names are
    shown as spaces to the visitor, and the file name is displayed without the
    extension.
    You can set the default web page name not to be displayed by assigning a value
    to the
    $def variable. I set this to "index" by default.

    Making it pretty with CSS: Each link has a class="dynNav" attribute,
    in case you need to apply special formatting with CSS. If you create a .dynNav
    class, the formatting will override that of any A{....} tag redefinition you
    do.
    The padded slash following each link also has the dynNav class applied to it,
    with <span> tags. If you need to apply different formatting to the links
    and the slashes, create your style for the slashes as .dynNav, then override
    it
    for the links with an a.dynNav selector.
    */

    $def = "index"; //default web page for directories on your server.
    $dPath = $PHP_SELF; //Get the script path, relative to web root.
    $dChunks = explode("/", $dPath); //Separate out folder and file names by
    looking for slashes.
    ?>
    <a class="dynNav" href="/">Home</a><span class="dynNav"> >> </span> <!-- make
    a leading "home" link -->
    <?

    for($i=1; $i<count($dChunks); $i++){ //PHP arrays are 0 inxeded but we are
    skipping the first element because of the way explode() works.
    echo("<a class=\"dynNav\" href=\"/"); //Make each chunk a link.
    for($j=1; $j<=$i; $j++){ //Subloop to create the path for each chunk.
    echo($dChunks); //Write each piece of the chunk's path.
    if($j!=count($dChunks)-1) echo("/");//If that piece was a folder name, append
    a slash.
    }
    if($i==count($dChunks)-1) { //If the chunk is a file, not folder name...
    $prChunks = explode(".", $dChunks); //take out the file extension...
    if ($prChunks == $def) $prChunks = ""; //don't display the filename if it's
    index or whatever default you specified.
    $prChunks = $prChunks . "</a>"; //add the closing tag.
    } else
    $prChunks=$dChunks . "</a><span class=\"dynNav\"> / </span>"; //Otherwise,
    just use the chunk name, close the a tag and add a paddeslash for display.
    echo('\"\>');
    echo(str_replace("_" , " " , $prChunks)); //Finish writing the link, replacing
    underscores with spaces for the end user.
    }
    ?>

    avail Guest

  4. #3

    Default Re: Dynamic Breadcrumbs question

    Hello Tango,

    In my opinion, how far you want to go with programming breadcrumbs
    depends on what you'll be using them for. It looks like the code that
    got posted earlier creates file-based breadcrumbs, so if you're looking
    to illustrate a visitor's position in terms of their place in the file
    structure, the code will probably work for that.

    If you're looking to show a visitor's perspective in terms of site
    structure, like Home > Gallery > December 5th > Photo, then it might be
    easiest to make a static breadcrumb for each page. If the page itself
    is dynamic, then adding breadcrumbs is as simple as adding the base
    breadcrumbs, then maybe defining a variable based on the database entry
    you're pulling. If you're working with a scripting language, you'll
    probably figure out how to do this pretty easily.

    Hope that helps.

    Chris S.
    Implied By Design
    [url]http://www.impliedbydesign.com[/url]
    Free Web Development Programs and Scripts
    [url]http://www.impliedbydesign.com/free-software-scripts.html[/url]

    google@impliedbydesign.com Guest

Posting Permissions

  • You may not post new threads
  • You may 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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139