I am trying to create a Dynamic Left Navigation using Umbraco 12.
I created a page type called Content Page (alias contentPage) that has 2 compositions Content and Page Settings
In Page Settings, I added 2 fields the 1st one is called "Show on Left Nav" (which is a true or false) this field will be to determine if the page will show as a link on the left navigation.
The 2nd one is called Left Nav Section (alias leftNavigationSection) (Which is a dropdown with the values for the different sections that will have different navigations) - This one will determine what section the page belongs to
Here is an example of what the data will look like
Home Human Resources (Show in Left Nav Y and Section Human
Resources)
Employee Forms (Show in Left Nav Y and Section Human
Resources)
Budget (Show in Left Nav N and Section Human Resources)
Employee Info (Show in Left Nav N and Section Human Resources)
Documents (Show in Left Nav N and Section Human Resources)
when you visit any of the pages under the Human Resources section (Employee Forms, Documents, etc. ) The query should return the links
Human Resources
Employee Forms
because they belong to the "Human Resources" section and the left nav setting is yes
While the links for
Budget
Employee Info
Documents
should be hidden from the left nav because the left nav setting is No
No matter what page in the "Human Resources" section you are viewing you should load all the visible links for the section the page belongs to
The value for Model.Value("leftNavigationSection") comes from a Dropdown and I can print it to the screen without any issues
In conclusion, I am trying to read the setting for the page the user is on and based on that value show the left navigation items that are the same ..
Over all I am asking, How can I build my own query based on a parameter I am adding all my to all my content types. (without using the query builder that generates a GUID)
Building a Custom Query
I am trying to create a Dynamic Left Navigation using Umbraco 12.
I created a page type called Content Page (alias contentPage) that has 2 compositions Content and Page Settings
In Page Settings, I added 2 fields the 1st one is called "Show on Left Nav" (which is a true or false) this field will be to determine if the page will show as a link on the left navigation.
The 2nd one is called Left Nav Section (alias leftNavigationSection) (Which is a dropdown with the values for the different sections that will have different navigations) - This one will determine what section the page belongs to
Here is an example of what the data will look like
when you visit any of the pages under the Human Resources section (Employee Forms, Documents, etc. ) The query should return the links
because they belong to the "Human Resources" section and the left nav setting is yes
While the links for
should be hidden from the left nav because the left nav setting is No
No matter what page in the "Human Resources" section you are viewing you should load all the visible links for the section the page belongs to
This is the query I have so far
The value for Model.Value("leftNavigationSection") comes from a Dropdown and I can print it to the screen without any issues
In conclusion, I am trying to read the setting for the page the user is on and based on that value show the left navigation items that are the same ..
Over all I am asking, How can I build my own query based on a parameter I am adding all my to all my content types. (without using the query builder that generates a GUID)
is working on a reply...