.. _custom_templates: ============================= Using your own menu templates ============================= .. contents:: :local: :depth: 2 ----- Writing custom menu templates ============================= .. _template_context_variables: What context variables are available to use? -------------------------------------------- The following variables are added to the context for each menu template or sub-menu template that you create: :``menu_items``: If the template is for rendering the first level of a main or flat menu, then ``menu_items`` will be a list of ``MainMenuItem`` or ``FlatMenuItem`` objects (respectively). In all other cases. it will be a list ``Page`` objects. In either case, wagtailmenus adds a number of additional attributes to each item to help keep you menu templates consistent. For more information see: :ref:`menu_items_added_attributes` :``current_level``: An integer indicating the current level being rendered. This starts at ``1`` for the initial template tag call, then increments by one for each additional ``