Page Blocks Visibility

Hello all,

After installing a number of modules, the list of page blocks available to our site builders is now quite extensive. For novice users, we fear this longer list could be confusing. It would be really useful if any of the following could be applied/investigated?

  1. Could we hide selected blocks using CSS?
  2. The option to pin selected blocks to the top of the block listing?
  3. The ability to restrict block visibility by user role?
  4. Tooltips to offer information on each block?

I appreciate these are all quite different, but any guidance would be much appreciated.

Best wishes,
John

This is a problem I’ve thought some about, as the set of even core-provided blocks has grown. I’d be interested to know how specifically you’re looking to limit the choices.

In terms of your specific questions:

  1. CSS certainly works. A style like

    #new-block button[value="asset"] { display: none; }
    

    will hide the button for the “Asset” block (by selecting on its value attribute, the internal identifier for the block). This is extensible to any blocks you’d want to hide. A small module could load CSS like this on the admin side, and could choose to do it differently based on user role, etc.

  2. Moving the blocks around, or pinning some, is something that would more likely involve core changes, or a more complex module. Are you thinking of this as something users would be able to customize for themselves, or that the administrator would set?

  3. I think I addressed this to some extent with my answer on number 1.

  4. Tooltips are a possibility, though we’d have to work out space for them to appear in the interface. Again that’s probably a core change that would be required there. And then modules would have to choose to provide their own tooltips once that feature existed, so there’s a fair amount that would have to happen there.

Hi John,

Many thanks indeed for your swift and detailed response.

In terms of limiting block display, the blocks I’d conceal relate to additional modules we’ve installed. Often there are a selection of blocks we use frequently from a module, with little need for the rest; after several modules are installed this list can accumulate! It’s not a problem for me, but with many new users about to start using the installation it’s something I’ve been asked to consider.

In response to each point:

  1. Thanks for sharing the CSS styling to remove individual blocks; we’ve not investigated modules before, but I’ll pass this on to my team (and perhaps even have a go myself too).

  2. In our case we’re focusing on inexperienced users, trying to remove as many barriers as possible. As such, pinned or ‘core’ blocks at the top of the list, determined by an administrator, would be ideal. I’d be quite happy to tell them what they want!

The blocks we’d pin are those which add media and text to a page, so probably Media Embed, Item Showcase, HTML, and the Resource Text from the BlockPlus module.

  1. Indeed, if we could account for different user roles in a module that would be great.

  2. Yes, I can imagine the difficulty in applying tooltips, especially with additional blocks provided by modules.

All the best,
John