EnsureNavFields
Takes two parameters, FieldBase, FieldNamesList
Description:
Use EnsureNavFields to Ensure the list of Fields that the HtmlNavbar and HtmlNav command uses exist in the Query. Typically, you would have setup the Query to contain all of the information you wish to use to build a menu with ahead of time, then call EnsureNavFields, and then Set or Build your data into each of the Nav Fields. At the moment, the fields are:
- Nav.Dropdown - An optional Drowndown Group with each item in the Group having the same value will be placed under a Dropdown Menu
- Nav.Header - An optional Header Group with each item in the Group having the same value, or a single - on just one item to insert a divider with no text based header
- Nav.URL - URL the Nav Item will link to
- Nav.Active - True/False flag to auto-add the 'active' class to the item
- Nav.Class - Optional class(es) to use for this list items
- Nav.NewTab - If True (not blank) will set URL to open in a new Tab/Window
- Nav.Content - Typically just the text to show to the user for the that item, but may contain more complex output such as buttons or even forms etc.
Once you have a Query with the above Fields in it and all of the values set as you wish, use the HtmlNav or HtmlNavbar commands to place the Nav on the page.
Example:
See EnsureFields