Problem/Motivation

The book settings page has a setting "Content type for child pages". This setting actually only determines the default content type used in the link "Add child page" on book pages.

Proposed resolution

Change the label to "Default content type for 'Add child page link'". Also and a help text explaining in more detail what this setting does.

Remaining tasks

Create patch.

User interface changes

Changes widget label

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

botris’s picture

Discussed this with pwolanin, the Book module maintainer, and agreed that this is a bug and label should be changed.
Working on this now.

drubb’s picture

Just a minor thing that came to my mind: 'default type' implies the type can be changed when adding child pages. That's not the case, so maybe it should just be 'type'? And I think, there's no type for a link, so maybe the original label is just fine?
Nevertheless the original issue #2472563 shouldn't be closed, it's about the description, not the label.

botris’s picture

Status: Active » Needs review
FileSize
1.13 KB

Patch

botris’s picture

drubb, please have a look at the issue description and patch. The label and held text need to be changed as it suggests a functionality that it doesn't provide.

ifrik’s picture

Status: Needs review » Needs work

Thanks, that these labels make much more sense now.

Just one small change because in other admin themes, the "Add child page" link and the help text for the radio button might be displayed differently.
How about:
"Users with the Add content and child pages to books permission can have a shortcut Add child page with each book node. This link will open a new node of the type selected here."

botris’s picture

Status: Needs work » Needs review
FileSize
1.36 KB
1.15 KB

Changed phrasing mostly as per your suggestion and but removed the word node.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patches!

I think this needs some work:

  1. +++ b/core/modules/book/src/Form/BookSettingsForm.php
    @@ -45,9 +45,10 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    -      '#title' => $this->t('Content type for child pages'),
    +      '#title' => $this->t('Default content type for the %add-child-page link', array('%add-child-page' => $this->t('Add child page'))),
           '#default_value' => $config->get('child_type'),
    

    I agree with the previous comment... "Default" doesn't really make sense here. This is the *only* content type that the Add child page link will use, not a "default".

    Also I don't see why we use variable substitution here? It should just be
    t('Content type for the Add child page link') right?

  2. +++ b/core/modules/book/src/Form/BookSettingsForm.php
    @@ -45,9 +45,10 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    +      '#description' => $this->t('Users with the %add-content-to-books-perm permission can have a shortcut %add-book-page with each book node. This link will open the <em>add new content</em> screen for the type selected above.', array('%add-content-to-books-perm' => $this->t('Add content and child pages to books'), '%add-book-page' => $this->t('Add child page'))),
    

    Again, why use variable substitution here?

    Also do not use the word "shortcut". This is just a link. And not something users "can" have, they will have it if they have the permission.

    Well actually I think we should get rid of this description. We do not need to explain this IMO. At least we do not need to write an essay on it... I think no description is fine.

botris’s picture

Status: Needs work » Needs review
FileSize
670 bytes

Ok so I've changed it, only the label that's updated and no variable substitution.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, thanks! Sorry for the delay in reviewing, I was on vacation.

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! It's good that we were able to communicate the information without adding extra text.

This issue only changes user-facing strings and markup, so per https://www.drupal.org/core/beta-changes, this can be completed any time during the Drupal 8 beta phase. Committed and pushed to 8.0.x!

  • xjm committed 05cc734 on 8.0.x
    Issue #2473089 by boris sondagh, jhodgdon, drubb, ifrik: Book settings...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.