3352550-Hook help for block content
Closes #3352550
Merge request reports
Activity
added 1 commit
- 6d0790f7 - 3352550 - Add custom block content new permission in help hook.
added 26 commits
-
6d0790f7...67fc8fbf - 24 commits from branch
project:10.1.x - a934c457 - 3352550-Hook help for block content
- c9811b53 - 3352550 - Add custom block content new permission in help hook.
-
6d0790f7...67fc8fbf - 24 commits from branch
added 11 commits
-
c9811b53...6629a163 - 9 commits from branch
project:10.1.x - 67e6619f - 3352550-Hook help for block content
- 13df6ab8 - 3352550 - Add custom block content new permission in help hook.
-
c9811b53...6629a163 - 9 commits from branch
26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit block types with fields and display settings, from the <a href=":types">Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; +1 for the suggestion
Edited by Ralf Koller
26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 30 30 $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; 31 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Content blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; I would extend that point:
$output .= '<dd>' . t('Users with the permission <em>Administer block content</em> or <em>Create new content block</em> for an individual block type are able to add content blocks. These can be created on the <a href=":add-content-block">Add content block page</a> or on the <em>Place block</em> modal on the <a href=":block-layout">Block Layout page</a> and are reusable across the entire site. Content blocks created in Layout Builder for a content type or individual node layouts are not reusable and also called inline blocks.', [':add-content-block' => Url::fromRoute('block_content.add_page')->toString(), ':block-layout' => Url::fromRoute('block.admin_display')->toString()]) . '</dd>';that way the reader gets to know the permissions necessary to create a content block. and in the second sentence it is explained where you are able to create those blocks plus it is noted that blocks created in those two places are reusable across the entire sites. and in contrast in the last sentence it is added that the user is also able to create content blocks within layout builder and that those blocks are not reusable. that is a detail i wasn't really aware until i've tried to understand the inner workings of block content being able to come up with suggestions for the micro copy. and it is also a detail many of the attendees in user groups we've visited haven't been quite clear about. therefore i think it would be reasonable step to explicitly state it in that paragraph.
26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 30 30 $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; 31 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 32 $output .= '</dl>'; 33 $output .= '<dt>' . t('Viewing custom blocks page') . '</dt>'; 26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 30 30 $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; 31 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 32 $output .= '</dl>'; 33 $output .= '<dt>' . t('Viewing custom blocks page') . '</dt>'; 34 $output .= '<dd>' . t('Users with the <em>Access the Custom block library page</em> permission can view custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>.', [':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 34 $output .= '<dd>' . t('Users with the <em>Access the Custom block library page</em> permission can view custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>.', [':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 34 $output .= '<dd>' . t('Users with the <em>Access the Content blocks overview page</em> permission can view content blocks of each defined block type, from the <a href=":block-library">Content blocks page</a>.', [':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 35 $output .= '<dt>' . t('Creating content blocks') . '</dt>'; 36 $output .= '<dd>' . t('Users with the <em>Access the Content blocks overview page</em> permission and of the <em>Block type: Create new content block</em> permissions can create new content blocks from the <a href=":add-content-block">Add content block page</a>.', [':add-content-block' => Url::fromRoute('block_content.add_page')->toString()]) . '</dd>'; 37 $output .= '<dt>' . t('Updating content blocks') . '</dt>'; 38 $output .= '<dd>' . t('Users with the <em>Access the Content blocks overview page</em> permission and of the <em>Block type: Edit content block</em> permissions can edit content blocks of from the <a href=":block-library">Content blocks page</a>.', [':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>';
22 22 $field_ui = \Drupal::moduleHandler()->moduleExists('field_ui') ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#'; 23 23 $output = ''; 24 24 $output .= '<h3>' . t('About') . '</h3>'; 25 25 $output .= '<p>' . t('The Custom Block module allows you to create and manage custom <em>block types</em> and <em>content-containing blocks</em>. For more information, see the <a href=":online-help">online documentation for the Custom Block module</a>.', [':online-help' => 'https://www.drupal.org/documentation/modules/block_content']) . '</p>'; I wonder if the following detail would make sense. at the moment the about is just listing the scope of available functions (manage custom block types and content containing blocks - that is sort of abstract and the terms aren't inline with the recent renames). in general i tried to orient to the node help page. in the second part of the suggestion i just tried to express that block content consists of content entities and config entities (i am not a developer and sort of in lack of the technical detail to phrase it correctly plus not a native speaker - the current version is just a rough initial suggestion to communicate the gist). but i think it would be helpful and important to clearly state the special nature of block content. @rocketeerbkw also mentioned that the placement config also contains references to a content entity so you cant just export on dev and import on production like you are able to with for example node type config. and having a not that technical about section stating those details might be beneficial (i haven't known until started to dig into the whole block content topic in the course of meta issue).
$output .= '<p>' . t('The Block Content module manages the creation, editing, and deletion of content blocks. Content blocks are field-able content entities managed by the <a href=":field">Field module</a>. In which theme region a content block is displayed plus the block\'s visibility settings is stored in configuration alongside. For more information, see the <a href=":block-content">online documentation for the Block Content module</a>.', [':block-content' => 'https://www.drupal.org/documentation/modules/block_content', ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</p>';
26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; i wonder if it would make sense to align the order of the
Usespoints to the ones on the node help page. Switching the first two points, the third remains on the same position and adding a fourth pointuser permissions:- Creating content blocks
- Creating and managing block types
- Viewing content blocks
- User permissions
26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 30 30 $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; 26 26 $output .= '<h3>' . t('Uses') . '</h3>'; 27 27 $output .= '<dl>'; 28 28 $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; 29 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 29 $output .= '<dd>' . t('Users with the <em>Administer block types</em> permission can create and edit custom block types with fields and display settings, from the <a href=":types">Custom Block types</a> page under the Structure menu. For more information about managing fields and display settings, see the <a href=":field-ui">Field UI module help</a> and <a href=":field">Field module help</a>.', [':types' => Url::fromRoute('entity.block_content_type.collection')->toString(), ':field-ui' => $field_ui, ':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>'; 30 30 $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; 31 $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 31 $output .= '<dd>' . t('Users with the <em>Administer block content</em> permission can create, edit, and delete custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>. After creating a block, place it in a region from the <a href=":blocks">Block layout page</a>, just like blocks provided by other modules.', [':blocks' => Url::fromRoute('block.admin_display')->toString(), ':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 32 $output .= '</dl>'; 33 $output .= '<dt>' . t('Viewing custom blocks page') . '</dt>'; 34 $output .= '<dd>' . t('Users with the <em>Access the Custom block library page</em> permission can view custom blocks of each defined custom block type, from the <a href=":block-library">Custom blocks page</a>.', [':block-library' => Url::fromRoute('entity.block_content.collection')->toString()]) . '</dd>'; 32 35 $output .= '</dl>'; and the fourth usage point i've already mentioned in my second comment is to keep things inline with the
Usagepoint on the node help page:$output .= '<dt>' . t('User permissions') . '</dt>'; $output .= '<dd>' . t('The Block Content module provides a number of permissions for each block type, which can be set by role on the <a href=":permissions">permissions page</a>.', [':permissions' => Url::fromRoute('user.admin_permissions.module', ['modules' => 'block_content'])->toString()]) . '</dd>';