cuny-academic-commons / commons-in-a-box

Commons In A Box - A suite of community and collaboration tools for WordPress, designed especially for academic communities
http://commonsinabox.org
72 stars 14 forks source link

The About Sidebar should appear on Brand pages as well as their descendants #444

Closed boonebgorges closed 11 months ago

boonebgorges commented 1 year ago

See https://cboxopenlab.org/groups/help-forum/forum/topic/openlab-theme/#post-308 for discussion.

In that discussion, the possibility is raised of having multiple page templates available, some of which would have an additional sidebar. We're not going to pursue this for the time being, but instead are going with the simpler workaround suggested there, namely:

we expand the conditions so that the About Sidebar appears whenever looking at a “brand page” or a descendant of a brand page

boonebgorges commented 1 year ago

This is done in cuny-academic-commons/openlab-theme@a749d3db5090221ab025ea5e158c33394c9cc823.

I also added some logic to ensure that the relevant parent page is highlighted on descendants of the brand pages. So, if this menu contains a link to 'About', it will be highlighted as the current page if you're on 'About' or on any descendant of 'About'. I can see reasons why you might not want this, but it seemed to me that it would be more confusing if nothing at all was highlighted in this case. Let me know if you want this changed.

bree-z commented 11 months ago

Hi Boone,

This looks good on the About page and its descendants. But what should it look like for Help?

Can users still have a setup like we do on https://cboxopenlab.org, where About and Help have different sidebar menus?

On openlabdev.commonsinabox.org, the main Help page shows the 'About' menu at the top of the page, and in the sidebar. In Brand Settings > Customize > Menus, the Help menu is set to show its own menu.

Thanks!

boonebgorges commented 11 months ago

As mentioned above, I made a change so that the About sidebar is used on any brand page, or descendant of a brand page. These criteria captured the top-level Help page. I've now made a change so that there's an exception in the case of the Help brand page. (Help "subpages" aren't really pages at all but are items in the "help" CPT, and so they didn't experience this problem.)

bree-z commented 11 months ago

This looks good, thanks!