[Javascript] Dynamic breadcrumbs script

Atkins, Kevin D kevin.atkins at nwa.com
Wed Sep 1 09:19:57 CDT 2004


Hi Paul,

Paul,

I am just getting caught up from being on vacation and starting to work
on this again. Are you able to help/explain this further? The coding
change you describe is valid, but not what I am trying to do. I guess I
didn't explain this very clearly. I don't want to write the last nodes
html file name on screen. I want the node that gets written to have the
actual full url path including the html page written into the node.

What I am seeing in my testing is like this. I have a home page called
index.html, the node name gets written as Home, the url of the Home node
gets written as http://www.something.com/, why is the code dropping
index.html from the node url?. I want the url of the node to be written
as http://www.something.com/index.html. By dropping the real html page
it looks to me that the code assumes all pages in all folders will have
an index.html file. On my site I have multiple folders and the main page
in those folders is not called index.html. 

On the home page I have 2 url links called test page1 and test page 2.
Test page 1 is called test-page1.html, found in a folder called page1.
Test page 2 is called test-page2.html found under folder /page1/page2.
When test page 1 is selected, the node gets written as Home > Page 1 >
Test Page 1. The url for the Page 1 node gets written as
http://www.something.com/page1, the node should be written as
http://www.something.com/page1/test-page1.html. The same thing happens
for the next node for test page 2 and so on.

I hope this makes sense? If you can help me further to understand the
code and make changes I would appreciate it, if not just let me know and
I will move on. Thanks again.

Kevin Atkins
Sr. Analyst Flight Operations
612-727-6732

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Paul Novitski
Sent: Tuesday, August 24, 2004 12:10 PM
To: [JavaScript List]
Subject: RE: [Javascript] Dynamic breadcrumbs script 

Kevin,

I figured out what you meant by the possessive pronoun "your" in your 
posting: you were thinking that a script you found in the LaTech
JavaScript 
archives is the collective child of the current listserve 
membership.  Instead, this listserve is a loose collection of
individuals 
each contributing their own bits to the collective soup.  Any script 
contributed by a listserve member is the intellectual child of that
member, 
and may not be known to or understood by other members.  Not a critical 
distinction, but one worth noting for future reference.

I suspect that the script you're referring to is the dynamic breadcrumbs

script written by Harry Love, as described in
https://lists.latech.edu/pipermail/javascript/2002-August/004019.html

His script is located at
<http://healthlinks.washington.edu/scripts/dynacrumbs.js>http<http://hea
lthlinks.washington.edu/scripts/dynacrumbs.js>://healthlinks.washington.
edu/scripts/dynacrumbs.js

Quickly perusing Harry's script, I see that it creates breadcrumb links
in 
the format
         Base > node > node > node
from the current page's URL.

In a quick test, I didn't see the final node (the html file itself) 
included in the breadcrumb array, regardless of its file name
(index.html 
or dynacrumbs.html).  It seems clear that Harry was deliberately
omitting 
that node.

The final for/next loop of the script begins this way (where urlL is the

number of nodes in the URL):

         if(urlL>2)
         {
                 for(x=startPoint+1;x<urlL;x++)
                 {
                         if(x<urlL-1)

In other words, that last if-test is excluding the final node of the 
array.  If you change that last line to:

                         if(x<urlL)

then your html file name will be displayed.  You might wish to tweak the

display by deleting the file extension, etc.

Good luck,
Paul


At 07:18 AM 8/24/2004, Atkins, Kevin D wrote:
>Paul,
>
>Thanks for the reply. The script I found and am trying to use comes
from
>your site called Dynamic Breadcrumbs, I am attaching the code I am
>using. I can also send a few test pages to see how I have added in the
>javascript code to call the external breadcrumb file.
>
>You can't view any of the files on my site because it is a secured
>Intranet site that only employees are allowed to login into and view. I
>am hoping you don't need to view the actual pages on my site to help me
>modify the script?
>
>I will try to describe my site and file structure in case this can help
>to understand the layout and how I think the code is acting. I share a
>server instance with another department, we both have a separate
virtual
>server to store our files. An example of my area is
>www.something.com/fop at this level is my index.html page.
>
>I changed the var startname in the breadcrumb script to Home. When the
>breadcrumb code runs it rights out Home > correctly on my index.html
>page. The url assigned is www.something.com/fop, it does not show
>index.html in the url link as the page to load. Clicking the Home
>breadcrumb reloads the index.html page, leading me to think the
>breadcrumb code thinks every breadcrumb link will have an index.html
>file in the folders or directories.
>
>I created 2 test links on my test index page, the folder structure is
>/fop/page1 and /fop/page1/page2. When Test page 1 is selected on the
>index.html page the breadcrumb gets written ok as Home > Page1 > Test
>Page 1. The breadcrumb url link for Test page1 is written as
>www.something.com/fop/page1/. If you click the Page1 breadcrumb url it
>does not reload test page1 called test-page1.html. Instead it displays
a
>file list of all files in the page1 folder. I think because it does not
>see an index.html page in the page1 folder.
>
>What I am trying to get is the breadcrumb url to be written as
>www.something.com/fop/page1/test-page1.html. The same thing happens for
>test page 2. Is there a way for the breadcrumbs.js file to actually
read
>the url of the page you are on and write that into the breadcrumb url
>link and not assume it is index.html?
>
>I am sorry if my explanation doesn't make sense, I hope it does? If you
>can't help because you can't see the files in actual use, that's ok, I
>will just have to look for another script somewhere. Thanks for your
>time.
>
>Kevin Atkins
>Sr. Analyst Flight Operations
>612-727-6732


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list