In my default layout (admin/structure/layouts/manage/default), when I go to add a visibility condition to a block, I don't see an option for "Content type" in the dropdown. Instead I only see "Home Page", "Site Language", "URL Path", "User Permission", "User Account: UID", and "User: Role".

According to another forum post this should be available - https://forum.backdropcms.org/forum/ill-show-you-block-only-page-i-want-how. Am I missing something obvious?

This is for Backdrop 1.25.0.

 

 

Accepted answer

Hi dbassendine!

The default layout doesn't have node as "context". Therefore that option is not available, since the system doesn't have a way to know what node you are viewing. 

Instead, you should override the node/% path by creating a new layout with that path. That will utomatically add "node" as context. You can basically use the same blocks and template as the default layout, except that you'll have "node" as context (added automatically, given the path), which will allow you to add visibility conditions for your blocks. 

Backdrop will use this layout whenever you view a node (regardless of whether you view it with path node/X or with its alias).

Comments

Hi dbassendine!

The default layout doesn't have node as "context". Therefore that option is not available, since the system doesn't have a way to know what node you are viewing. 

Instead, you should override the node/% path by creating a new layout with that path. That will utomatically add "node" as context. You can basically use the same blocks and template as the default layout, except that you'll have "node" as context (added automatically, given the path), which will allow you to add visibility conditions for your blocks. 

Backdrop will use this layout whenever you view a node (regardless of whether you view it with path node/X or with its alias).

Thanks for your help! I will give it a go.