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

More declarative method for defining navigation sections #731

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

nonprofittechy
Copy link
Member

Fix #262

like #726 does for the drop-down menu, this creates a method to control the navigation items on the left in a more declarative way. The author can provide datastructure that is recalculated fresh on whatever basis makes sense for the interview (reconsider modifier, inline call to reconsider, or depends on modifier as appropriate). The datastructure will list every potential menu item and then put the rule for turning the item on or off in the optional hidden key.

Because we have a lot of existing interviews that use the simpler sections syntax to define static sections, this behavior is turned off by default.

Example:

---
code: |
  enable_al_nav_sections = True
---
reconsider: True
variable name: al_nav_sections
data from code:
  - item1: |
      "Label1"
  - item2: |
      "Label2"
  - item3: |
      "Label3"
    hidden: _internal.get('steps') < 2

Format Python code with psf/black push
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

Successfully merging this pull request may close these issues.

Add a method for adaptive navigation
1 participant