- Issue created by @amietpatial
- First commit to issue fork.
- Merge request !12386Issue #3351245: Added a custom hint to Layout Builder block form to help users discover hidden features โ (Closed) created by Unnamed author
- ๐ฎ๐ณIndia Kanchan Bhogade
Hi
I have reproduced the issue on Drupal 11.x and MR applied successfully;
but issue still persist with patchAttaching screenshot for reference
- ๐บ๐ธUnited States smustgrave
Sorry confused by this MR. Core doesnโt take in custom modules
- Merge request !12391Issue #3351245: Added a custom hint to Layout Builder block form โ (Open) created by Unnamed author
- ๐ฎ๐ณIndia ajinkya45 Pune
Fixed by adding a conditional UI hint that appears only for WYSIWYG inline blocks.
/**
* Implements hook_form_FORM_ID_alter() for layout_builder_add_block form.
*/
function layout_builder_form_layout_builder_add_block_alter(array &$form, &$form_state, $form_id) {
$storage = $form_state->getStorage();
$plugin_id = '';if (isset($storage['layout_builder__component']) && is_object($storage['layout_builder__component'])) {
$component = $storage['layout_builder__component'];
// Get the block plugin ID from the SectionComponent.
if (method_exists($component, 'getPluginId')) {
$plugin_id = $component->getPluginId();
}
}// Define the block plugins where hint is needed.
$wysiwyg_blocks = [
'inline_block:basic',
'inline_block:disclaimer_block',
];// If current block is in the list, show the hint.
if (in_array($plugin_id, $wysiwyg_blocks) && isset($form['settings']['block_form'])) {
$form['settings']['block_form']['#prefix'] = '
More options like image upload may be hidden below. Expand block to view them.';
}
} - ๐บ๐ธUnited States smustgrave
I donโt think adding a hook is the right approach. Should find in the code where this is happening and fix at the root
- ๐ฎ๐ณIndia ajinkya45 Pune
Understood, will check if itโs possible to add this at the plugin level instead of using a form alter hook.
- ๐ฎ๐ณIndia ajinkya45 Pune
This is my proposed solution (Video layout_builder.mp4 attached for reference).
- Adds a "View more" tooltip above the CKEditor 3-dots ("Show more items") button as a hint,
- When clicked, stacks the dropdown buttons vertically โ also hides unwanted separators
- Make the "Show more" dropdown cleaner and readable in narrow sidebars.
Would love your feedback on this