How do I create breadcrumb site navigation in frontpage 2003?

F

FrontpageJay

Hi
I guess the title says it all. How do I create breadcrumb site navigation in
frontpage 2003?
I have been all over the internet and microsofts sites trying to get this
breadcrumb thing to work and either the instructions make no scense or are so
coplicated that if I knew how to read the solution I could have written the
Frontpage program in my sleep. I have spent hours on end trying to get
various java scripts to work without any success.
I just upgraded from version 2002 to 2003 thinking it may be easier to do
but its all just the same old problems.
Any help would be greatly appreciated. I am not a programmer but do have an
understanding of html.
Thanks a lot.
Best regards, Jay
 
T

Trevor L.

FrontpageJay said:
Hi
I guess the title says it all. How do I create breadcrumb site
navigation in frontpage 2003?

You could try this. It isn't dependent on the version of FrontPage

Add this to an external JS file, say external.js:
function breadCrumbs()
{
// Were passed parameters
var base = 'myname.mydomain.com' // change to your website name
var delStr = '>>' // string between page names
var defp = 'index.html' // change if your default page is different
var cStyle = '' // These 3 styles can be altered
var tStyle = ''
var dStyle = ''
var nl = 0 // change to 1 if new line required
// ----------------------

//----Internal functions --------
function getLoc(c)
{
var d = ""
if (c > 0)
for (var k = 0; k < c; k++)
d += "../"
return d
}
//-------------------------------
function makeCaps(a)
{
var g = a.split(' ')
for (var l = 0; l < g.length; l++)
g[l] = g[l].toUpperCase().slice(0,1) + g[l].slice(1)
return g.join(" ")
}
//----End of internal functions --------

var loc = window.location.toString()

var subs = loc.substr(loc.indexOf(base) + base.length+1).split("/")
document.write
( '<a href="' + getLoc(subs.length - 1) + defp + '"'
+ ' class="' + cStyle + '">Home</a>'
+ '<span class="' + dStyle + '">' + delStr + '</span>')

var a = (loc.indexOf(defp)==-1) ? 1 : 2
for (var i = 0; i < (subs.length - a); i++)
{
subs = makeCaps(unescape(subs))
document.write
( '<a href="' + getLoc(subs.length-i-2) + defp + '"'
+ ' class="' + cStyle + '">' + subs + '</a>'
+ '<span class="' + dStyle + '">' + delStr + '</span>')
}

if (nl == 1) document.write("<br>")

document.write
( '<span class="' + tStyle + '">'
+ document.title + '</span>' )
}

In the <head> of each page, add
<script type="text/javascript" src="scripts/external.js"></script>

In the <body> of each page, add at the top
<script type="text/javascript">breadCrumbs();</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top