If you are creating web pages, say for an intranet, blog etc and use parent and response documents for the structure then here's how you can make breadcrumbs using Lotus Notes formula. There's breadcrumbs will be infinite (well 32k infinite).
I once used to use stored UNIDS but then along came @While, @For and @Trnsform and made formula even more powerful.
Pop a computed field where you want the the breadcrumbs to appear and then add the following formula (you may need to change some variables etc to suit your taste).
REM {Get all the documents ancestors and pull the fields we want off them to make some breadcrumb navigation};
parentUNID:=@Text($REF);
titleList := "";
UNIDList:=@Text($REF);
@While( (parentUNID != "") ;
titleList:=@GetDocField(parentUNID;"Title"): titleList;
UNIDList:=@Text(@GetDocField( parentUNID ; "$Ref" )):UNIDList;
parentUNID := @Text(@GetDocField( parentUNID ; "$Ref" ))
);
breadcrumb:=""+@Trim(titleList:Title)+"";
@Implode(breadcrumb ; " > " ) +"
";
breadcrumbHTML:= ""+Title+"";
REM {Because the home page is document (the first document with a title of "Home") the we should prevent the breadcrumb a link to it twice if we have navigated to it using ?OpenDocument and not ?OpenDatabase. We don't want to se Home > Home as breadcrumb};
@If(@LowerCase(Title)="home";
"Home";
"Home > "+breadcrumbHTML)
0 comments:
Post a Comment