Constellation.Feature.Navigation NuGet Package

Requires Sitecore 10.3
Requires .NET Framework 4.8

Constellation is a collection of utilities for .NET CMS implementers.
The Feature.Navigation library addresses the three most common forms of Navigation on Sitecore sites:

Declared (static) Navigation: (explicitly defined, may differ from the shape of the content tree)

- DeclaredNavigationRepository.GetNavigation - Accepts a Navigation Menu item and assembles a full tree-like ViewModel for immediate processing in your View.

If you need context highlighting in your navigation, be sure to pass in the Context Item as well.

When using NavigationLink objects, there are usually several opportunities to supply the text of a given link. NavigationLink.GetBestLinkText() evaluates all of them and attempts to
supply the best fit. The strategy is based on overriding the concept of "name". Here are the rules:
- If Use This Display Name is checked on the NavigationLink item, it wins.
- If the Link.Text is supplied by the user, it wins.
- If the Link.TargetItem exists and inherits from Page Navigation Title, and the field value is not null, it wins.
- If the Link.TargetItem exists its DisplayName is used.
- Assuming all other things are not true, use the NavigationLink's DisplayName.

Note that in this condition if you intended to point to a Sitecore Item, you have a bad link.

Branch (Context) Navigation: (implicitly defined. It follows the shape of the Content Tree)

- BranchNavigationRepository.GetNavigation - Accepts the request Context Item (should be a Page) and generates a tree of BranchNodes representing
the nearest LandingPage, its children, as well as the descendants of any children that are Ancestors of the Context Item. (will also create Children for the Context Item node
in the tree). Use this to produce the expanded navigation seen on many sites with deep content.

Breadcrumbs: (implicitly defined.

It walks up the Content Tree to get the path)

- BreadcrumbNavigationRepository.GetNavigation - Accepts the request Context Item and Context SiteInfo. Generates an array of Breadcrumb models you can enumerate on your View.
The breadcrumbs will start on your Site's StartItem and end with the supplied Context Item, which will be marked IsContextItem so you can change your rendering behavior.
Uses the Item.Axes.GetAncestors() method to generate the list of breadcrumbs.

The included package must be installed to use this library. This should happen automatically after you build and deploy your project.




Got any Constellation.Feature.Navigation Question?





Info

Version: 10.3.0.25486
Author(s): Richard J. Cabral
Last Update: Friday, June 16, 2023
.NET Fiddle: Create the first Fiddle
Project Url: https://constellation4sitecore.com/feature/navigation/
NuGet Url: https://www.nuget.org/packages/Constellation.Feature.Navigation


Install
Install-Package Constellation.Feature.Navigation
dotnet add package Constellation.Feature.Navigation
paket add Constellation.Feature.Navigation
Constellation.Feature.Navigation Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

2.5

avg-downloads-per-day

19

days-since-last-release

312