Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #723
Adds a new user-facing magic keyword:
al_menu_items_custom_items
which should be a list of menu items. Custom items are shown before default menu items.Each menu items follows the Docassemble menu item format, which is a dictionary with the keys
url
andlabel
. It can be convenient, and readable, to use adata from code
block to define the menu items, but you can use any method to create the right Python datastructure.Optionally, you can add a key
hidden
which contains a True/False value. If the value isTrue
the menu item won't be shown. This can be used to dynamically show or hide the menu item on a given page. If the value is dynamic, you should add areconsider
modifier on the block that definesal_menu_items_custom_items
.E.g.,
Note that if the visible state isn't dynamic, the author can use a
data
block instead of adata from code
block. This will make the label translatable. Alternatively, the author can add a template for the label to make it available for translation.