# Breadcrumbs (disable folder link)

**URL:** <https://forum.kirupa.com/t/breadcrumbs-disable-folder-link/298325>\
**Category:** web dev\
**Created:** [October 16, 2009, 2:45pm UTC](https://forum.kirupa.com/t/breadcrumbs-disable-folder-link/298325 "2009-10-16T14:45:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tracy981](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@Tracy981](https://forum.kirupa.com/u/Tracy981)\
**Post date:** [October 16, 2009, 2:45pm UTC](https://forum.kirupa.com/t/breadcrumbs-disable-folder-link/298325/1 "2009-10-16T14:45:23Z")

</div>

I found a breadcrumbs script here - [http://www.webhostingtalk.com/archive/index.php/t-521215.html](http://www.webhostingtalk.com/archive/index.php/t-521215.html)

It works great but is there a way to disable a folder link so it just becomes text?

for example test site here - [http://www.2020aec.com/About\_Your\_Eyes/Cataracts/test2.php](http://www.2020aec.com/About_Your_Eyes/Cataracts/test2.php)

home \> about your eyes \> cataracts \> test2.php

home = link  
about your eyes = link  
cataracts = DISABLE link feature and becomes plain text  
test2 = title page (plain text)

This is the code that I am using -

[http://www.2020aec.com/About\_Your\_Eyes/Cataracts/testcrumb2.js](http://www.2020aec.com/About_Your_Eyes/Cataracts/testcrumb2.js) (same as below)

```php
// Enter your domain name here,
var url = "www.2020aec.com";

// Enter the word you want to use to describe the home page of your site
var home = "Home";

// Enter the character(s) you want to use to separate your breadcrumbs
var divide = "&raquo;";

// Enter text you'd like to see. You can make this blank as well - "";
var pre = "";

// Enter the extension you use for your pages
var ext = ".php";

var sp = "_";

// Enter the default file name you use for the root file of your folders
var root = "index";

// Want to replace any folder names with custom names of your own? Create
// replacement pairs in the following format: swap* = 'Old Words|New Words';
swap = new Array(); // Don't touch this line!
// Remove comments from swap array variables below to put them into use.
// Create additional replacement items by increasing the array number * as
// you add more lines.

swap[0] = 'index|';
swap[1] = 'Sitemap|';

//////////////////////////////////////////////////////////////////////////////
// DO NOT TOUCH ANYTHING BELOW THIS LINE //
// unless done in accordance with the instructions at the top of the page. //
//////////////////////////////////////////////////////////////////////////////

divide = " " + divide + " ";
var a = "" + window.location;
var b = "";
var bar = divide + root;
var code = "";
var foo = root + ext;
var left = "";

a = a.replace(ext,"");
left = a.lastIndexOf("/");

if (a.substring(a.lastIndexOf("/")) == "/") {
a = a + root;
}

b = a.substring(left+1);
b = b.replace(/_/g," ");
b = b.replace(/#/g,divide);

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/-/g," ");

code = divide + b;
b = "/" + b
b = b.replace(divide,"#");
b = b.replace(/ /g,"_");

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/ /g,"-");

a = a.replace(b,"");

if (a.substring(left-1) != "/") {
do {
left = a.lastIndexOf("/");
b = a.substring(left+1);
b = b.replace(/_/g," ");

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/-/g," ");

code = divide + "<a href=\"" + foo + "\">" + b + "</a>" + code;
foo = "../" + foo;
b = "/" + b;
b = b.replace(/ /g,"_");

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/ /g,"-");

a = a.replace(b,"");
} while (a.substring(left-1) != "/");
}

code = code.replace(url,home);
code = code.replace(bar,"");
code = (code.substring(code.indexOf("<")));
code = pre + code;
document.getElementById('breadcrumbs').innerHTML = code;

```

any help would be greatly appreciated.
