I know this probably goes against the plugin main functionality, but would it be possible to create an automatic accordion menu with all the pages (and their hierarchy) of the whole website?
There are two approached to accomplishing. Both will require the following widget options:
Always display child pages = checked
Maximum level of child pages to display = Total levels of pages your site has.
Display widget on every page = checked
Top level parent page to use for this widget = You highest level parent page.
Enable accordion menu = checked
Include highest level parent in accordion = checked
The first approach requires your site have a common highest level page. All pages on your site should be children or grandchildren of this top level parent. Using the following additional widget options will make everything work:
Display highest level parent page = unchecked
The other approach will work if you site has various top level parent pages and does not require all pages to be children or grandchildren of a common parent. First set the following addition widget options:
Display highest level parent page = checked
You will then need to use a template override in your theme to change the structure of the menu
Create a new folder in your active theme called advanced-sidebar-menu.
Create a new file within the new folder called page_list.php.
Add the following code to the new file.
You menu will then contain all top level pages and their children with accordion functionality.
I tried approach 2 and while it works to make a site map, however it also applies to all the other menus and I definitely don’t want that. Is it possible to apply this new behaviour to just one accordion id?
Hi Ricardo,
There are two approached to accomplishing. Both will require the following widget options:
The first approach requires your site have a common highest level page. All pages on your site should be children or grandchildren of this top level parent. Using the following additional widget options will make everything work:
The other approach will work if you site has various top level parent pages and does not require all pages to be children or grandchildren of a common parent. First set the following addition widget options:
You will then need to use a template override in your theme to change the structure of the menu
advanced-sidebar-menu
.page_list.php
.You menu will then contain all top level pages and their children with accordion functionality.
Hi,
Thank you so much for your reply!
I tried approach 2 and while it works to make a site map, however it also applies to all the other menus and I definitely don’t want that. Is it possible to apply this new behaviour to just one accordion id?
Thanks again!
Hi Ricardo,
If you would like to target a specific widget you may add this code near the top of the template and change the id to match your widget:
If you would like to target a specific sidebar you may add this code near the top of the template and change the id to match your sidebar:
The end result will be something like this: