From d3fe2d41e2a0bd0a554d0994f0c1221f6f2f17b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Thu, 5 Aug 2021 08:49:32 +0200 Subject: [PATCH] add bootstrap5 templates; add extra_class_ul variable --- docs/source/templatesmod.rst | 16 +++++++++++++++- sitetree/templates/sitetree/menu_bootstrap.html | 2 +- sitetree/templates/sitetree/menu_bootstrap3.html | 2 +- sitetree/templates/sitetree/menu_bootstrap4.html | 2 +- sitetree/templates/sitetree/menu_bootstrap5.html | 13 +++++++++++++ .../sitetree/menu_bootstrap5_dropdown.html | 6 ++++++ sitetree/templates/sitetree/menu_foundation.html | 2 +- 7 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 sitetree/templates/sitetree/menu_bootstrap5.html create mode 100644 sitetree/templates/sitetree/menu_bootstrap5_dropdown.html diff --git a/docs/source/templatesmod.rst b/docs/source/templatesmod.rst index 666b6785..5dce284b 100644 --- a/docs/source/templatesmod.rst +++ b/docs/source/templatesmod.rst @@ -14,6 +14,12 @@ Nevertheless pay attention that menu template also uses two CSS classes marking * **current_item** — marks item in the tree, corresponding to current page; * **current_branch** — marks all ancestors of current item, and current item itself. +If needed, you can set extra CSS classes to the *ul* element with `extra_class_ul` variable. For example:: + + {% with extra_class_ul="flex-wrap flex-row" %} + {% sitetree_menu from "footer_3" include "trunk,topmenu" template "sitetree/menu_bootstrap5.html" %} + {% endwith %} + .. _overriding-built-in-templates: @@ -125,7 +131,11 @@ The following templates are bundled with SiteTree: * `sitetree/menu_bootstrap4.html` - The same as above but for Bootstrap version 3. + The same as above but for Bootstrap version 4. + + * `sitetree/menu_bootstrap5.html` + + The same as above but for Bootstrap version 5. * `sitetree/menu_bootstrap_dropdown.html` @@ -139,6 +149,10 @@ The following templates are bundled with SiteTree: The same as above but for Bootstrap version 4. + * `sitetree/menu_bootstrap5_dropdown.html` + + The same as above but for Bootstrap version 5. + * `sitetree/menu_bootstrap_navlist.html` This template can be used to construct a Bootstrap Nav list. diff --git a/sitetree/templates/sitetree/menu_bootstrap.html b/sitetree/templates/sitetree/menu_bootstrap.html index e12aabed..5b169033 100644 --- a/sitetree/templates/sitetree/menu_bootstrap.html +++ b/sitetree/templates/sitetree/menu_bootstrap.html @@ -1,5 +1,5 @@ {% load sitetree %} -