Resolve #3483304 Allow disabling page displays for node types
Closes #3483304
Merge request reports
Activity
- Resolved by Lee Rowlands
- Resolved by Lee Rowlands
- Resolved by Lee Rowlands
added 3 commits
added 3 commits
117 117 $this->submitForm($edit, 'Save (this translation)'); 118 118 $edit = [$this->fieldName . '[0][alt]' => 'Scarlett Johansson image', $this->fieldName . '[0][title]' => 'Scarlett Johansson image title']; 119 119 $this->submitForm($edit, 'Save (this translation)'); 120 $this->drupalGet('/node/' . $default_language_node->id()); 27 35 '_permission' => 'access content overview', 28 36 ]); 29 37 } 38 39 // @todo Move this to a subscriber in the Drupal\Core\Routing namespace 40 // https://www.drupal.org/project/drupal/issues/3484255 Not sure why https://www.drupal.org/project/drupal/issues/3484255 is the follow-up for making this generic to different entity types when that issue is adding a feature. Two questions I guess:
-
Is it complex to implement it for all entity types here?
-
Should there be a different follow-up issue for this if the answer to #1 is 'yes'?
-
added 23 commits
-
3931297c...e39157a2 - 6 commits from branch
project:11.x
- e39157a2...1766b0fc - 7 earlier commits
- bab78fee - Lint
- 0c7c3b33 - typo
- 6edb7766 - Lint
- a8103ced - Fix namespace
- 1d216b1c - Fix unit test
- ff9c9768 - Fix test
- d70edadb - Remove from form displays
- 1b280e7f - Fix last test
- 7f14c887 - Fix final test
- fb314768 - Remove deprecation, no nice way to do it
Toggle commit list-
3931297c...e39157a2 - 6 commits from branch
22 protected EntityFieldManagerInterface $entityFieldManager, 23 protected EntityDisplayRepositoryInterface $entityDisplayRepository, 24 protected RouteBuilderInterface $routeBuilder, 25 ) { 34 26 } 35 27 36 28 /** 37 29 * {@inheritdoc} 38 30 */ 39 public static function create(ContainerInterface $container) { 31 public static function create(ContainerInterface $container): static { 40 32 return new static( 41 $container->get('entity_field.manager') 33 $container->get(EntityFieldManagerInterface::class), 34 $container->get(EntityDisplayRepositoryInterface::class), 35 $container->get(RouteBuilderInterface::class), 178 172 '#title' => $this->t('Display settings'), 179 173 '#group' => 'additional_settings', 180 174 ]; 175 $full_display = NULL; 176 if (!$type->isNew()) { 177 $full_display = $this->entityDisplayRepository->getViewDisplay('node', $type->id(), 'full'); 178 } 179 $form['display']['page_display'] = [ 180 // @todo Move this to the entity view display edit form in 181 // https://www.drupal.org/project/drupal/issues/3484255 182 '#type' => 'checkbox', 183 '#title' => $this->t('Create page display'), 184 '#default_value' => $full_display === NULL || $full_display->hasPageDisplay() || $full_display->isNew(), 185 '#description' => $this->t('Uncheck this to prevent the content-type from having a full page display.'), Nit: Mostly we see
content type
rather thancontent-type
unless it's referring to the HTTP header.
Had a bit of a read through the MR. My main concern is with the term "page display". I don't really know what that means, but I also don't have a better suggestion. We already have view display and form display but it seems that page display is something that applies to view displays.
Have left a couple other remarks.
Agree that the terminology is challenging and "page display" is confusing to introduce here. We have the same concept for media and the setting is called "Standalone media URL" but it's different because in that case, the default is off and the edge case is on. "Standalone node URL" really does not sound right! But that's also why the checkbox is hard because it's easier to explain what happens when you uncheck the box.
Basically I have no suggestions, just noting this needs more thought.
added 60 commits
-
fb314768...8aeb2ca5 - 43 commits from branch
project:11.x
- 8aeb2ca5...e809359f - 7 earlier commits
- 48faae4b - Lint
- e80e20d6 - typo
- 1727d2ad - Lint
- ae96ad79 - Fix namespace
- 79105269 - Fix unit test
- eef21f03 - Fix test
- 30879f54 - Remove from form displays
- 53b6aa1b - Fix last test
- b9e6f86b - Fix final test
- a3d54d8e - Remove deprecation, no nice way to do it
Toggle commit list-
fb314768...8aeb2ca5 - 43 commits from branch