A code snippet for LEPTON CMS. It provides a complete menu function. All menu data is retrieved using a single database query, all types of menu styles (lists, breadcrums, sitemaps) can be generated with extensive customisation of the resulting HTML.


  • As sm2 is part of the LEPTON package the addon is only provided together with LEPTON CMS. For details in development please visit LEPTON repository on github.
  • Latest stable stand alone version: show_menu2, version 4.9.6  (11. Juli 2013)


A demo website showing many of the different types of menus that can be created using this function is at Example Page


Full documentation for the function can be read in the README file (as included in the zip file). Note that this is documentation from the latest version of show_menu2.


Release announcements for this component are posted at LEPTON addons page.


This module is released under the GPL licence.


4.9 (10 Aug 2009)
Partially redacted the change introduced in 4.8. Now hidden pages are shown when active only if the SM2_SHOWHIDDEN flag is supplied. The default behaviour should be the same as 4.7

4.8 (8 Apr 2009)
Fixed output of menu when a hidden page is the current or parent page.

4.7 (21 Oct 2008)
Re-released v4.7 with an updated german translation of the readme.txt. No changes to anything else.

4.7 (16 Oct 2008)
New functionality. See the extended options in the readme.

4.6 (22 Apr 2008)
Fix for page_id = 0 in search results. Requires changes to templates, WB settings and possible WB core files.

4.5 (10 Apr 2008)
Support for WB 2.7 multiple groups and publish date (thanks to Thorn for updates). This version still works in WB 2.6.7 and is not substantially different from 4.41 released by Thorn.

4.4 (6 Sep 2007)
Added SM2_ESCAPE flag for HTML escaping of output. Deprecated SM2_NOESCAPE flag and made it the default.

4.3 (29 Aug 2007)
Added SM2_BUFFER flag for output buffering. Added SM2_CURRTREE to restrict output to only the current menu tree.

4.2 (18 Aug 2007)
Added handling for multiple tests with boolean AND/OR logic to conditional formatting. See this sample for an example of usage. Permit whitespace anywhere within conditional expressions.

4.1 (15 Aug 2007)
Added optional else clause to conditional formatting. See this sample for an example of usage.

4.0 (19 Dec 2006)
Add greater than equal (>=), less than equal (<=) logic to conditional formatting. Added ability to test against page level and page ID in the conditional formatting. Removed the sm2_ prefix from the legacy functions in legacy.php so that when including this file the standard show_menu and page_menu functions are transparently redefined to use show_menu2.

3.9 (1 Nov 2006)
Add Not Equal (!=) logic to conditional formatting (thanks to Ezra Peisach for the fix).

3.8 (27 Aug 2006)
Log an error if none of the group 1 flags are specified. Fix bug where private pages that were not accessible by the current user were still visible in the menu (thanks to afbelow for the fix).

3.7 (24 Aug 2006)
Call htmlspecialchars on all strings to ensure that the output menu items are valid HTML. Added new flag SM2_NOESCAPE to turn off this escaping.

3.6 (15 Aug 2006)
Added new flag SM2_SIBLING to show breadcrumbs + current page siblings only.

3.5 (2 Aug 2006)
Added new flag SM2_PRETTY to provide indenting menu HTML for debugging. Added conditional formatting directive (see CONDITIONAL FORMATTING in the documentation).

3.1 (1 June 2006)
Fix bug where menu displays incorrectly on the search results page (Thanks to succhi for updates). Added new flag SM2_NOCACHE.

3.0 (28 May 2006)
Beta 8 released as version 3.0 unchanged

3.0 beta 8 (22 May 2006)
Last major rewrite for 3.0 release. Arguments changed to match the old show_menu more: item format and item open arguments are combined. Added ability to pass false for any of the item or menu arguments to get the default. The location to add the class string now must be added manually using the [class] format string. See the readme for details.

2.6.1 (1 May 2006)
Fix for warnings being generated in the PHP error log about array_keys. Fix for an error if there is no menu for the current page (e.g. for search results).

Powered by LEPTON