Results
05.08.2020
drutopia_blog 8.x-1.x-dev ::
drutopia_blog.links.action.yml
drutopia_blog.add_blog:
route_name: 'node.add'
route_parameters:
node_type: 'blog'
title: 'Add blog'
appears_on:
- view.blog.page_listing 05.08.2020
drutopia_campaign 8.x-1.x-dev ::
drutopia_campaign.links.action.yml
drutopia_campaign.add_campaign:
route_name: 'node.add'
route_parameters:
node_type: 'campaign'
title: 'Add campaign'
appears_on:
- view.campaign.page_listing 05.08.2020
drutopia_event 8.x-1.x-dev ::
drutopia_event.links.action.yml
drutopia_event.add_event:
route_name: 'node.add'
route_parameters:
node_type: 'event'
title: 'Add event'
appears_on:
- view.event.page_listing 14.09.2023
drutopia_organization 2.0.x-dev ::
drutopia_organization.links.action.yml
drutopia_organization.add_organization:
route_name: 'node.add'
route_parameters:
node_type: 'organization'
title: 'Add organization'
appears_on:
- view.organization.page_listing 05.08.2020
drutopia_people 8.x-1.x-dev ::
drutopia_people.links.action.yml
drutopia_people.add_people:
route_name: 'node.add'
route_parameters:
node_type: 'people'
title: 'Add person'
appears_on:
- view.people.page_listing 10.08.2020
drutopia_resource 8.x-1.x-dev ::
drutopia_resource.links.action.yml
drutopia_resource.add_resource:
route_name: 'node.add'
route_parameters:
node_type: 'resource'
title: 'Add resource'
appears_on:
- view.resource.page_listing 22.05.2020
dynamic_entity_reference 8.x-1.x-dev ::
tests/src/Functional/DynamicEntityReferenceWidgetTest.php
$field_name . '[0][target_id]' => $referenced_node->getTitle() . ' (' . $referenced_node->id() . ')',
];
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
// Only 1 target_type is configured, so this field is not available on the
// node add/edit page.
$assert_session->fieldNotExists($field_name . '[0][target_type]');
$this->submitForm($edit, 'Save');
$node = $this->drupalGetNodeByTitle($title);
$assert_session->pageTextContains(sprintf('reference_content %s has been created.', $node->label()));
$field_name . '[0][target_id]' => $referenced_entity->label() . ' (' . $referenced_entity->id() . ')',
];
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
// Multiple target_types are configured, so this field should be available
// on the node add/edit page.
$assert_session->fieldExists($field_name . '[0][target_type]');
$this->submitForm($edit, 'Save');
$node = $this->drupalGetNodeByTitle($title);
$assert_session->pageTextContains(sprintf('reference_content %s has been created.', $node->label()));
$field_name => $referenced_node->getEntityTypeId() . '-' . $referenced_node->id(),
];
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
// Only one bundle is configuerd, so optgroup should not be added to
// the select element.
$assert_session->elementNotContains('css', '[name=' . $field_name . ']', 'optgroup');
$this->submitForm($edit, 'Save');
$node = $this->drupalGetNodeByTitle($title);
$field_name => $referenced_node->getEntityTypeId() . '-' . $referenced_node->id(),
];
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
$this->submitForm($edit, 'Save');
$node = $this->drupalGetNodeByTitle($title);
$assert_session->pageTextContains(sprintf('reference_content %s has been created.', $node->label()));
$nodes = \Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties(['title' => $title]);
$field_config->save();
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
// Multiple target_bundles configured, optgroup should be added to the
// select element.
$assert_session->elementContains('css', '[name=' . $field_name . ']', 'optgroup');
$field_config->setSetting('node', $node_setting);
} 06.06.2020
eav_field 2.x-dev ::
tests/src/Functional/EavFieldTest.php
$attribute_value_widget_settings = $attribute->getValueWidgetSettings();
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'product']));
$this->dontSeeErrorMessage();
$this->submitForm([
'title[0][value]' => 'Product for ' . __FUNCTION__,
'field_category' => $this->categories['string_attr']->id(),
], 'Save');
$this->dontSeeErrorMessage(); 23.09.2020
entity_hierarchy 8.x-2.24 ::
src/Handler/NodeEntityHierarchyHandler.php
*/
public function getAddChildUrl(EntityTypeInterface $entityType, ContentEntityInterface $parent, $bundle, $fieldName) {
return Url::fromRoute('node.add', [
'node_type' => $bundle,
], [
'query' => [
$fieldName => $parent->id(),
],
]); 13.07.2022
entity_reference_field_create_link 1.x-dev ::
src/Plugin/Field/FieldWidget/EntityReferenceAutocompleteCreateLink.php
case 'node':
$build['add_links'][$linkKey] = $this->getAddLink(
'node.add',
'node_type',
$this->entityTypeManager
->getStorage('node_type')
->load($bundle)
);
break; 17.08.2020
entityconnect 8.x-2.0-rc1 ::
src/Controller/EntityconnectController.php
switch ($entity_type) {
case 'node':
$route_name[] = 'node.add';
break;
case 'user':
$route_name[] = 'user.admin_create';
break; 17.08.2020
entityconnect 8.x-2.0-rc1 ::
tests/src/Functional/EntityconnectAdminTest.php
// Open the create test page.
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => $this->testContentType->id()]));
// By default, the entityconnect buttons should not exist.
$this->assertSession()->elementNotExists('xpath', '//div[contains(@class, \'entityconnect-\')]/input');
$this->drupalLogout();
// Edit the entity reference field.
$this->drupalLogin($this->adminUser); 25.09.2020
epub_reader_framework 2.0.0-alpha2 ::
src/Form/ReaderPublicationFormAlter.php
// If we are on the node add page, remove chapters completely.
if ($this->routeMatch->getRouteName() == 'node.add') {
$form['field_reader_chapters']['#access'] = FALSE;
}
// Remove normal add more button.
$form['field_reader_chapters']['widget']['add_more']['#access'] = FALSE;
->getAccessControlHandler('node');
if ($access_check->createAccess('reader_chapter', $user)) {
$url = Url::fromRoute('node.add', ['node_type' => 'reader_chapter']);
if ($url->access($user)) {
// If we have a node ID (ie, editing existing), append the ID.
/** @var \Drupal\Core\Entity\EntityForm $form_object */
$form_object = $form_state->getFormObject();
if ($form_object instanceof EntityFormInterface && $entity = $form_object->getEntity()) { 25.09.2020
epub_reader_framework 2.0.0-alpha2 ::
src/Form/ReaderChapterFormAlter.php
// Redirect to adding a publication.
$url = Url::fromRoute('node.add', [
'node_type' => 'reader_publication',
])->toString();
$response = new RedirectResponse($url);
$response->send();
}
} 25.09.2020
epub_reader_framework 2.0.0-alpha2 ::
src/Entity/ReaderEntityPostsave.php
// Redirect to the publication if editing or adding a chapter.
if (in_array($route_name, ['entity.node.edit_form', 'node.add'])) {
$this->redirectToPublication($entity);
}
}
// Check if we still have not processed the epub.
if ( 18.07.2020
examples 3.x-dev ::
modules/config_entity_example/tests/src/Functional/RobotReferenceTest.php
/** @var \Drupal\config_entity_example\Entity\Robot $robot */
$robot = reset($robot);
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => $type->id()]));
$this->submitForm(['title[0][value]' => 'title', 'field_robot_reference[0][target_id]' => $robot->label()], 'Save');
$assert->statusCodeEquals(200);
$assert->pageTextContains($robot->label());
}
} 18.07.2020
examples 3.x-dev ::
modules/pager_example/src/Controller/PagerExamplePage.php
'#rows' => $rows,
'#empty' => $this->t('There are no nodes to display. Please <a href=":url">create a node</a>.', [
':url' => Url::fromRoute('node.add', ['node_type' => 'page'])->toString(),
]),
];
// Add our pager element so the user can choose which pagination to see.
// This will add a '?page=1' fragment to the links to subsequent pages.
$build['pager'] = [
'#type' => 'pager', 10.06.2020
field_group 8.x-3.1 ::
tests/src/FunctionalJavascript/HorizontalTabsLabelsTest.php
// Actual test: check the node edit page. Tab1 and Tab2 should be present.
$this->drupalGet(Url::fromRoute('node.add', [
'node_type' => $this->testNodeType->id(),
]));
$this->assertHorizontalTabsLabels();
// Create a node.
$this->page->fillField('title[0][value]', 'Field Group Horizontal Tabs Test Node'); 18.05.2020
filefield_sources_jsonapi 8.x-1.0-beta9 ::
filefield_sources_jsonapi.module
function filefield_sources_jsonapi_page_attachments(array &$page) {
$route_name = Drupal::request()->attributes->get('_route');
if (in_array($route_name, ['entity.node.edit_form', 'node.add'])) {
$xuacompatible = [
'#tag' => 'meta',
'#attributes' => [
'http-equiv' => 'x-ua-compatible',
'content' => 'ie=edge',
], 30.03.2020
form_mode_manager 8.x-1.x-dev ::
modules/examples/src/Controller/FrontPage.php
$items['#items'][] = $this->t('<a href="@url">@label',
[
'@url' => Url::fromRoute('node.add', ['node_type' => $node_type->id()])->toString(),
'@label' => $node_type->label(),
]
);
}
return [
'intro' => [ 