Hello!
I am trying to figure out the best way to manage the Breadcrumbs Pattern, but I can't seem to grasp the way it is intended to be used.
{ a!localVariables( local!currentNodeId: 4, /* This variable would normally be retrieved with a rule like rule!getBreadcrumbsForIdentifier(identifier: local!currentNodeId). */ local!nodes: a!forEach( items: enumerate(local!currentNodeId) + 1, expression: choose( fv!item, a!map(name: "Home", identifier: 1), a!map(name: "My Documents", identifier: 2), a!map(name: "Strategy", identifier: 3), a!map(name: "2018 Road Map", identifier: 4) ) ), { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!forEach( items: local!nodes, expression: if( fv!isLast, a!richTextItem(text: fv!item.name, style: "STRONG"), { a!richTextItem( text: fv!item.name, /* The saveInto in this link would run the query or rule necessary to navigate the user to * * the node in the breadcrumbs that they just clicked on. */ link: a!dynamicLink( value: fv!item.identifier, saveInto: local!currentNodeId ), linkStyle: "STANDALONE" ), a!richTextItem(text: " / ", color: "SECONDARY") } ) ) } ) } ) }
I'm particularly confused by the way we are supposed to redirect the user to other screens and get the identifier. Does it mean that every page needs an identifier? How do I manage this data?
The only application of this pattern I saw uses a CDT called "Breadcrumbs" (without a table) and constants-pointers to objects we are redirecting to, but this way seems not to be as programmatic as it could be.
What would be the best way to solve this?
Discussion posts and replies are publicly visible
All your questions depend so much on what you want to achieve and what this application is about. And, why is that even necessary?
My pages have the following structure:
.└── Home├── Subject 1│ ├── Quiz│ ├── Documents│ └── Online Resources└── Subject n├── Quiz├── Documents└── Online Resources
I want to be able to navigate this hierarchy freely and breadcrumbs seem to be the solution. I'm just wondering how to set identifiers for different screens and pass them around. I was thinking of setting the identifier to 1 in a local variable of the main interface, then increment by 1 on each descendant interface, but the comments in the pattern mention an expression rule, which makes me wonder what am I missing.
You are aware that you can only add up to 10 top level tabs?
To be honest, in my mind is no real place for useful breadcrumbs in Appian applications. And no, you cannot really pass along the navigation path a user was following.
Thank you for your opinion and expertise, I appreciate it.