Monday, November 08, 2010 at 12:03 AM.

system.verbs.builtins.html.directory.getBreadcrumbString

on getBreadcrumbString (crumblist, uri, searchArgs="", flDirectoryHomeUrlEndsWithSlash=false) {
	local (crumbstring = "", ctcrumbs = sizeof (crumblist));
	on popuri (uri, levels) {
		return (html.directory.popuri (uri, levels))};
	if ctcrumbs == 0 {
		crumbstring = "<b>Top</b>"}
	else {
		local (i);
		if flDirectoryHomeUrlEndsWithSlash {
			crumbstring = crumbstring + "<a class=\"directoryCrumbLink\" href=\"" + popuri (uri, ctcrumbs) + "/" + searchArgs + "\">Top</a> > "}
		else {
			crumbstring = crumbstring + "<a class=\"directoryCrumbLink\" href=\"" + popuri (uri, ctcrumbs) + searchArgs + "\">Top</a> > "};
		for i = 1 to ctcrumbs - 1 {
			crumbstring = crumbstring + "<a class=\"directoryCrumbLink\" href=\"" + popuri (uri, ctcrumbs - i) + searchArgs + "\">" + string.replaceall (crumblist [i], " ", " ") + "</a> > "};
		crumbstring = crumbstring + "<b>" + crumblist [ctcrumbs] + "</b>"};
	return (crumbstring)}
<<bundle //test code
	<<dialog.alert (getBreadcrumbString ({"United States", "Western States", "California"}, "/us/west/ca"))



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.