minor updates & bug fixes

master
Steve Nyemba 1 year ago
parent b828a0a946
commit aec9275468

@ -33,6 +33,9 @@ class components :
#
# content of each menu item
_subItems = [ components.content (os.sep.join([_path,_name]))for _name in _items ]
if 'map' in _layout :
_items = [_name if _name not in _layout['map'] else _layout['map'][_name] for _name in _items]
_object = dict(zip(_items,_subItems))
#-- applying overwrites to the menu items
for _name in _object :

@ -189,6 +189,18 @@ if __name__ == '__main__' :
_config = json.loads((open (_path)).read())
_root = _config['layout']['root']
_config['layout']['menu'] = cms.components.menu(_root,_config)
if 'map' in _config['layout'] and 'order' in _config['layout'] and 'menu' in _config['layout']['order'] :
"""
We are insuring that the order of the menu items can be manually configured and have proper representation without quircks associated with folder name convention
"""
_map = _config['layout']['map']
labels = [_name if _name not in _map else _map[_name] for _name in _config['layout']['order']['menu']]
labels = [_name for _name in labels if _name in _config['layout']['menu']]
_config['layout']['order']['menu'] = labels
else:
_config['layout']['order']['menu'] = list(_config['layout']['menu'].keys())
# _config['data'] = cms.components.data(_config)
#
# Let us load the plugins if any are available

Loading…
Cancel
Save