Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Nodes at Startup #66

Closed
pbros opened this issue Feb 14, 2019 · 2 comments
Closed

Override Nodes at Startup #66

pbros opened this issue Feb 14, 2019 · 2 comments

Comments

@pbros
Copy link

pbros commented Feb 14, 2019

Hello,

In my navigation, I have links to external urls which change depending on the environment (Dev, QA, Staging, Production) the site is in running. Currently, I need to maintain a different navigation.xml per environment (e.g. navigation.QA.xml, navigation.Staging.xml), which is set in the navigation options in appSettings.json using "NavigationMapXmlFileName": "navigation.QA.xml",

The structure of all of these is identical except for the URLs of a few nodes.

Would it be possible to not have to maintain full xml files per environment, but instead have the ability to override certain node by key at startup. I know there is a node adjuster, but my understanding is that it's a per page/request override, and not a global one.

I would suggest maybe adding a dictionary to the Navigation Options, where we can set the Url per NodeKey.

@joeaudette
Copy link
Collaborator

I just published an updated nuget https://www.nuget.org/packages/cloudscribe.Web.Navigation/2.1.11

I added a new interface just for you INavigationTreeProcessor

you can implement and inject 1 or more of those and process the tree immediately after it is built and before it gets cached. I only added it for XmlNavigationTreeBuilder so it won't work currently for JsonTreeBuilder.

That gives you the opportunity to update any node using whatever logic you want.

@pbros
Copy link
Author

pbros commented Feb 15, 2019

Great, thanks! I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants