Making Adaptive Sidebars

Advanced Sidebar Menu

Once this plugin is installed, two blocks are available under “widgets”, one for use on pages, which makes use of your page hierarchy, and one for use on posts, using the category hierarchy.

Here is how the page version is supposed to work:

Display highest level parent page

When checked the menu will display the top level parent page on all menus. By default, if only the top level page would be shown, the menu will not display unless “Display menu when there is only the parent page” is also checked.

Display menu when there is only the parent page

Display the menu even if a single menu item will be shown. May only be used when “Display highest level parent page” is also checked.

Always display child pages

By default only the levels above the current page and one level below the current page will be shown. Use this option to show a set number of levels always.

Maximum level of child pages to display

Used when “Always display child pages” is checked to specify the number of levels to display. You may also select ” – All – ” to display every available level always.

For now I’m leaving these all unchecked. I have put the Advanced Content – Pages block in the left sidebar of the default Pages template. It is possible that I would like different settings on the home page, which would be a reason to change the home page template.

Sidebars with Block Themes

And here is a page that promises to teach me [almost] everything I need to know about creating menu sidebars using Twenty Twenty-two, although not about Advanced Content Sidebars; he’s not using that.

  • First, he creates a page template that has a header region, a footer region, and in between a two column region. He is putting the Post Title and Post Content in the wider region, which for him is on the left, and plans to use the right column as a “sidebar”. So far, so good.
  • He points out that all the options (like background color..) are available for the “sidebar” column. Style to suit.
  • He also wants to tell us how to make a “sticky” sidebar, one that stays in place as you scroll down to see content farther down. This takes a plugin, called “Sticky Block for Gutenberg Editor”. Install this as the first block in the “sidebar” column, and put everything else that you want in the sidebar into that block. (Use the list view!!!!!) The sticky block is just one of those “container” blocks, meant only to contain other blocks (like columns, group, row…) I tried this, but in the end it seemed to me that it did not work correctly on narrow windows, so I abandoned it.
  • Finally, he gets to making “dynamic” sidebars. And at this point, belatedly, he decides to create a custom template type. Which essentially he told you how to do in the first bullet above, so just do that to begin with! (Note that some block themes probably come with sidebar templates. But the very basic Twenty Twenty-Two theme that I am currently using does not.)

So in the end, it turns out, his “dynamic” sidebars are hand-crafted. My hope is that I can stick the Advanced Sidebar Menu block in the sidebar and it will work. For now, I’m going back to try to customize that block in the settings…

By golly, that seems to work perfectly!! Except I think I was expecting still to see all the top-level pages. No? No. Well, it isn’t perfect but it will do. The paid version might do a little better, but maybe not. You can always put a “Home” link at the top. If other pages are top level, it’s only going to show up to there? The simple example at the plugin site is incomplete, it seems to me.

The other thing I ended up doing was to pair this with breadcrumbs above. Together, this seems to me to be entirely satisfactory, at least for pages.

Notice that there is a way to exclude pages. This may turn out to be useful for a few pages that I would want people to access directly from the top menu, but I’m still working on this.

This is a great documentation site!

I notice that this same pootlepress site has a page on doing menus in block themes, a vexing topic. Also one on query loops. AND a Beginners Guide on custom post types!! How did I never stumble on this site before?

In fact, the ACF page above gives you a link to a free instance of a site set up in Twenty Twenty-two to play. What a concept!