Allow user to configure the block delta when creating the block

Created on 28 August 2013, over 11 years ago
Updated 14 February 2025, about 2 months ago

I have needed on more than one occasion to be able to predict the delta of a menu block when it is created, or to be in control of the delta in the way that views is.

Scenario:

  • A user-triggered event will create a menu block programmatically.
  • The menu block needs to appear in a specific region on one specific page of a sub-theme. This could be achieved through the block settings, however the entire site layout is configured by context so it would not be a pretty solution to control the placement of one block in a different way.
  • Since the block will only be created at some arbitrary time when the user triggers the event, the context must already be in place so that when the block is created it shows in the correct place immediately. The only way to achieve this is to create the context first, and since contexts control block placements using the block deltas we must know the delta of the menu block at this stage - i.e. before the block is created. Therefore the delta must be set in the context, and then programmatically applied to the menu block when it is created.

This means that I need an extra field added to the menu block admin form which will allow you to optionally set the block delta.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom melissavdh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada joelpittet Vancouver

    Unassigning this since leaving it assigned without active work can be misleading—it makes it look like it’s being worked on, preventing others from jumping in. Meanwhile, with the best intentions, the issue might end up forgotten.

Production build 0.71.5 2024