Created
August 16, 2022 15:19
-
-
Save hazho/ef9d6992893c46a3a3acf9b2667719e7 to your computer and use it in GitHub Desktop.
Hierarchic Custom Pages Menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
other blocks ... | |
''' | |
class CustomPagesMenuBlock(StructBlock): | |
menus=ListBlock(StructBlock([ | |
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Menu", help = "height for this video embed object")), | |
("children", ListBlock(StructBlock([ | |
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Sub-Menu")), | |
("children", ListBlock(StructBlock([ | |
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Sub-Sub-Menu")), | |
]))) | |
]))) | |
])) | |
class Meta: | |
icon = "" | |
template = "blocks/custom_pages_menu_block.html" | |
''' | |
other blocks ... | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
though the block is implemented inside an instance of pages model, however, this implementation can be applied to siteSettings as well, in a way you can call the instances of each single site publicly in the base.html sections other than the specific page streamfield sections