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

scripting2Suite.website.crumbTrail

on crumbTrail () {
	<<Changes
		<<7/10/07; 9:51:55 AM by DW
			<<Change "Weblog Archive" to "Archive."
		<<2/8/06; 3:53:54 PM by DW
			<<Gutted, re-created.
		<<11/12/03; 5:34:12 PM by DW
			<<Created.
	local (pta = html.getpagetableaddress (), day, month, year, hour, minute, second, htmltext = "", indentlevel = 0);
	date.get (pta^.scripting2.crumbTrailInfo.d, @day, @month, @year, @hour, @minute, @second);
	on add (s) {
		htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r"};
	
	local (baseurl = "http://htmlarchive.scripting.com/");
	add ("<a href=\"" + baseurl + "\">Archive</a>" + " > ");
	
	local (yearurl = baseurl + year + "/");
	add ("<a href=\"" + yearurl + "\">" + year + "</a> > ");
	
	if pta^.scripting2.crumbTrailInfo.flMonth {
		add ("<b>" + date.monthtostring (month) + "</b>")}
	else {
		local (monthurl = "http://www.scripting.com/" + year + "/" + string.padwithzeros (month, 2) + ".html");
		add ("<a href=\"" + monthurl + "\">" + date.monthtostring (month) + "</a> > ");
		
		if pta^.scripting2.crumbTrailInfo.flDay {
			add ("<b>" + day + "</b>")}
		else {
			local (dayurl = "http://www.scripting.com/" + year + "/" + string.padwithzeros (month, 2) + "/" + string.padwithzeros (day, 2) + ".html");
			add ("<a href=\"" + dayurl + "\">" + day + "</a>")}};
	
	<<scratchpad.crumbparams = pta^; edit (@scratchpad.crumbparams)
	return (htmltext)};
bundle { //test code
	html.setpagetableaddress (@scratchpad.crumbparams);
	dialog.alert (getCrumbTrail ())}



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.