ytgov / yukon-ca

New version of Yukon.ca, built on Drupal 10
1 stars 3 forks source link

Missing Title and breadcrumbs blocks on certain pages. #117

Open willsstrong opened 1 year ago

willsstrong commented 1 year ago

There is a bug in block settings where when the visibility settings for content types are set as negated, this has the unintended result of omitting the block from any page that is not a content type.

e.g. top-level blog index page, top-level blog page (e.g. Digital information and services blog)

block_config_page

This is manifested in our case as the title block and breadcrumbs block are appropriately omitted from homepage, landing page and landing page L2; but is also omitted from the Government of Yukon blogs page (a view page) as well as the blog listings for each blog type (taxonomy term pages).

blogs_landing_page

blog-type_term_page

Proposed Solution

Use the Block Visibility Conditions to allow better control over setting conditions in which block are shown or hidden.

leeomara commented 1 year ago

This appears to be the commit that relates to setting up visibility (to prevent them from being displayed on those specific content types): https://github.com/ytgov/yukon-ca/commit/1bd16b512aaa4060ac0b61146a1243cd65f7a561

Thanks to Simon for finding that.

leeomara commented 1 year ago

@willsstrong If you reverse the logic of this block configuration, does this issue persist? E.g. if you check all except for "Homepage", "Landing page" and "Landing page level 2", does title return to View and Taxonomy pages?

theteknocat commented 1 year ago

@leeomara in our experience, the reverse as you suggest does NOT make it work either. This block visibility configuration means you either ONLY show it on nodes of those types or you only show it on nodes NOT of those types, but either way NEVER on any other types of pages that are not nodes.

leeomara commented 1 year ago

So what's I'm hearing is that block visibility by node type is not appropriate for the site at all then, regardless of if the condition is negated or not.

leeomara commented 1 year ago

Why not use CSS to make the title invisible on pages for those select content types? That would avoid the whole "hiding the title here accidentally hides it there" mess.

theteknocat commented 1 year ago

@leeomara that's what we've done in our base site, actually. We did it that way because we still wanted a page title using the appropriate heading level for accessibility, but just not visible to the user.