Beispiel #1
0
 def render(self, context):
   menu = Menu.get(name=self.name.resolve(context))
   res = "<ul id=\"menu-%s\" class=\"menu clearfix %s\">" % (menu.key().id(), menu.name)
   items = menu.top_items()
   for item in items:
     res = res + MenuNode.render_item(self.request.resolve(context), item, context)
   res = res + "</ul>"
   return res
Beispiel #2
0
 def render(cls, context, name=""):
     menu = Menu.get(slug=name)
     context.update({"menu": menu})
     return cls.render_block(template_name="block_menu.html", block_title=_(name), context=context)