Results
02.11.2019
admin_ui 8.x-1.x-dev ::
admin_ui_support.routing.yml
options:
_node_operation_route: TRUE
_admin_related_route: 'node.add'
parameters:
node_type:
with_config_overrides: TRUE
admin_ui_support.node.edit:
path: '/vfancy/node/{node}/edit' 28.09.2018
bt_faq 8.x-1.x-dev ::
src/Breadcrumb/FaqBreadcrumbBuilder.php
*/
private $routes = array(
'node.add',
'page_manager.page_view_app_website_faq_app_website_faq-panels_variant-0',
'entity.node.edit_form',
);
/**
* Class constructor.
if (in_array($routeMatch->getRouteName(), $match)) {
if ($routeMatch->getRouteName() == 'node.add') {
if ($routeMatch->getParameters()->get('node_type')->get('type') == 'faq') {
return TRUE;
}
else {
return FALSE;
}
$breadcrumb->addLink(Link::createFromRoute('Website', 'page_manager.page_view_app_website_app_website-panels_variant-0'));
if ($route == 'entity.node.edit_form' || $route == 'node.add') {
$breadcrumb->addLink(Link::createFromRoute('Frequent Answer Question', 'page_manager.page_view_app_website_faq_app_website_faq-panels_variant-0'));
}
return $breadcrumb;
} 04.03.2018
bt_forum 8.x-1.x-dev ::
src/Breadcrumb/ForumBreadcrumbBuilder.php
*/
private $routes = [
'node.add',
'page_manager.page_view_app_website_forums_app_website_forums-panels_variant-0',
'entity.node.edit_form',
];
/**
* Class constructor.
$match = $this->routes;
if (in_array($routeMatch->getRouteName(), $match)) {
if ($routeMatch->getRouteName() == 'node.add') {
if ($routeMatch->getParameters()->get('node_type')->get('type') == 'forum') {
return TRUE;
}
else {
return FALSE;
}
$breadcrumb->addLink(Link::createFromRoute('Website', 'page_manager.page_view_app_website_app_website-panels_variant-0'));
if ($route == 'entity.node.edit_form' || $route == 'node.add') {
$breadcrumb->addLink(Link::createFromRoute('Forum', 'page_manager.page_view_app_website_forums_app_website_forums-panels_variant-0'));
}
return $breadcrumb;
} 20.08.2019
ifthenelse 8.x-1.x-dev-no-core ::
modules/contrib/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module
'title' => $type->label(),
'provider' => 'admin_toolbar_tools',
'route_name' => 'node.add',
'parent' => 'admin_toolbar_tools.add_content',
'route_parameters' => ['node_type' => $type->id()],
];
}
} 14.02.2018
material_admin_support 8.x-1.x-dev ::
material_admin_support.module
if ($access->isAllowed()) {
$url = new Url('node.add', ['node_type' => $type->id()]);
$links[] = [
'color' => type_style_get_style($type, 'color', '#039BE5'),
'icon' => type_style_get_style($type, 'icon', 'star'),
'href' => $url->toString(),
'tooltip' => $type->label(),
]; 04.04.2018
pki_ra 8.x-1.x-dev ::
src/Form/ResendVerificationEmailForm.php
else {
// When there is no registration attached with this email address.
$start_url = Url::fromRoute('node.add', ['node_type' => PKIRARegistrationProcessor::NODE_TYPE])->toString();
drupal_set_message($this->t('Registration with this email address not found. Please register <a href=":registration-start">here</a>.',
[':registration-start' => $start_url]), 'error');
}
}
} 04.04.2018
pki_ra 8.x-1.x-dev ::
src/Controller/PKIRAController.php
public function beginRegistrationProcess(Request $request) {
$introductory_message = $this->config('pki_ra.settings')->get('messages.introduction')['value'];
$start_url = Url::fromRoute('node.add', array('node_type' => PKIRARegistrationProcessor::NODE_TYPE));
$start_link = Link::fromTextAndUrl(t('Begin PKI Registration Process'), $start_url)->toRenderable();
return [
'#markup' => Xss::filterAdmin($introductory_message) . render($start_link),
];
}
drupal_set_message($this->t('You have tried to use a one-time e-mail verification link that has either been used, expired, or is no longer valid. Please restart the registration process using the form below.'), 'error');
return $this->redirect('node.add', ['node_type' => PKIRARegistrationProcessor::NODE_TYPE]);
}
protected function logRegistrationConfirmationAndNotifyUser($registration, $timestamp) {
$body = $this->config('pki_ra.settings')->get('messages.email_address_validated')['value'];
$this->getLogger('pki_ra')->notice('Registrant %email used one-time e-mail verification link at time %timestamp.', [ 29.12.2019
quadstat_misc 8.x-1.x-dev ::
quadstat_misc.module
// Add create class
elseif ($route_name == 'node.add') {
$variables['attributes']['class'][] = 'entity-create';
}
}
function quadstat_misc_menu_local_tasks_alter(&$data, $route_name) { 01.05.2018
selection_note 8.x-1.x-dev ::
selection_note.module
'#type' => 'link',
'#title' => t('Add Note'),
'#url' => Url::fromRoute('node.add', ['node_type' => $node_type->id()]),
'#attributes' => [
'class' => ['use-ajax', 'button', 'note-selection-button'],
'id' => ['note-selection-button'],
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => 700, 24.04.2019
simple_node_importer 8.x-1.0 ::
src/Controller/NodeImportController.php
'#header' => $tableheader,
'#empty' => $this->t('There are no items yet. <a href="@add-url">Add an item.</a>', [
'@add-url' => Url::fromRoute('node.add', ['node_type' => 'simple_node'])->toString(),
]),
];
}
return $output;
}
else {
$addLink = Url::fromRoute('node.add',
[
'node_type' => $val['type'],
'entity_type' => $entityType,
'refkey' => $val['reference'],
'bundle' => $val['type'],
], 31.12.2020
ttv_assistant 1.0.x-dev ::
src/Plugin/Block/AssistantBlock.php
public function build() {
$route_name = \Drupal::routeMatch()->getRouteName();
if (!in_array($route_name, ['node.add', 'entity.node.edit_form'])) {
return;
}
$assistant_config = \Drupal::config('ttv_assistant.settings');
$avatar = '';
if (isset($assistant_config->get('avatar')['fids'])) {
$file = File::load($assistant_config->get('avatar')['fids']); 04.03.2021
custom_action_links 1.0.x-dev ::
tests/src/Functional/CustomActionLinksTest.php
$assert->pageTextContains('Custom action link 1 details');
$page->fillField('settings[label]', 'This is a block title');
$page->fillField('settings[custom_action_links][0][route_details][route_name]', 'node.add');
$page->fillField('settings[custom_action_links][0][route_details][route_parameters]', 'node_type=article');
$link_text = 'Add an article<strong>!!!</strong>';
$page->fillField('settings[custom_action_links][0][route_details][link_title]', $link_text);
$page->pressButton('Save block');
$assert->pageTextContains('The block configuration has been saved.');
// Add another action link.
$assert->elementExists('css', 'tr[data-drupal-selector="edit-blocks-customactionlinks"]')->clickLink('Configure');
$page->fillField('settings[custom_action_links][1][route_details][route_name]', 'node.add');
$page->fillField('settings[custom_action_links][1][route_details][route_parameters]', 'node_type=page');
$page->pressButton('Save block');
$assert->pageTextContains('The text for action link is required.');
$page_link_text = 'Add page';
$page->fillField('settings[custom_action_links][1][route_details][link_title]', $page_link_text);
$page->pressButton('Save block');
$page->pressButton('Add and configure header');
$page->checkField('options[empty]');
$page->fillField('options[custom_action_links][0][route_details][route_name]', 'node.add');
$page->fillField('options[custom_action_links][0][route_details][route_parameters]', 'node_type=article');
$link_text = 'Add a page<strong>!!!</strong>';
$page->fillField('options[custom_action_links][0][route_details][link_title]', $link_text);
$page->pressButton('Apply');
$page->pressButton('Save'); 08.05.2021
field_completeness 1.0.3 ::
src/Plugin/Block/FieldCompletenessBlock.php
$bundle = $field_completeness_manager->getEntityBundleFromRoute();
}
if ($route_name == 'node.add') {
// Forbid access.
return AccessResult::forbidden();
}
if (!empty($bundle) && $field_completeness_manager->isAllowedContentType($bundle)) {
return AccessResult::allowed(); 16.02.2021
ckeditor5 1.0.x-dev ::
tests/modules/ckeditor5_test/src/Controller/CKEditor5OffCanvasTestController.php
'#type' => 'link',
'#title' => 'Add Node',
'#url' => Url::fromRoute('node.add', ['node_type' => 'page']),
'#attributes' => [
'class' => ['use-ajax'],
'data-dialog-type' => 'dialog',
'data-dialog-renderer' => 'off_canvas',
],
]; 10.08.2021
turbo_spa 1.0.x-dev ::
turbo_spa.module
// re rendering of previous form validation/submission errors.
// NB snapshot cache clears when you reload a page!!
$disable_snapshot = ['entity.node.edit_form', 'node.add'];
// @todo on all form pages only
// pages with /add /edit /update ++ .
// no-preview means don't show previews for this page.
// no-cache tells turbo to not snapshot.
$current_route_name = Drupal::routeMatch()->getRouteName();
if (in_array($current_route_name, $disable_snapshot)) { 03.10.2021
auto_load_location 1.0.0 ::
auto_load_location.module
$route_match = \Drupal::routeMatch();
$route = $route_match->getRouteName();
if ($route == 'node.add' ||
$route == 'entity.node.edit_form') {
// Add css/js library to node form page
$variables['#attached']['library'][] = 'auto_load_location/auto_load_location_library';
// Pass entity reference field name variable into drupalSettings
$location_field_name = \Drupal::config('auto_load_location.settings')->get('entity_reference_field_name');
$variables['#attached']['drupalSettings']['location_field_name'] = $location_field_name; 08.04.2024
comment_on_top 2.0.3 ::
comment_on_top_by_likes/comment_on_top_by_likes.module
//Selecting content types which have comments
if (($current_route === 'node.add' || $current_route === 'entity.node.edit_form')
&& array_key_exists('comment', $form)) {
$form['comment']['widget'][0]['stick_on_top_by_likes'] = [
'#type' => 'checkbox',
'#title' => t('Stick on top by likes'),
'#default_value' => $chckboxDefaultValue,
'#description' => t('Check this if you want to stick on top most liked comment in this node.'), 19.03.2024
content_dashboard 1.0.3 ::
content_dashboard.module
$url = Url::fromRoute('node.add', ['node_type' => $node_type]);
$variables['link'] = [
'#type' => 'link',
'#title' => t('Add') . ' ' . $node_type_label,
'#options' => $link['localized_options'],
'#url' => $url,
]; 31.07.2024
bef_entity_select_buttons 1.0.0-alpha1 ::
src/Service/ContentPathsService.php
protected function getNodeAddPath($bundle) {
if ($this->moduleHandler->moduleExists('node')) {
return $this->urlGenerator->generateFromRoute('node.add', ['node_type' => $bundle]);
}
return NULL;
}
protected function getEntityAddPath($definition, $bundle) {
$linkTemplate = $definition->getLinkTemplate('add-form'); 28.01.2025
file_bulkupload_translations 1.0.x-dev ::
tests/src/Functional/FileBulkuploadTranslationsWidgetTest.php
// // Attach a file to a node.
// $edit['files[' . $field_name . '_0]'] = $this->container->get('file_system')->realpath($test_file->getFileUri());
// $this->drupalGet(Url::fromRoute('node.add', ['node_type' => $type_name]));
// $this->submitForm($edit, 'Save');
// $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
//
// /** @var \Drupal\file\FileInterface $node_file */
// $node_file = File::load($node->{$field_name}->target_id);
// $this->assertFileExists($node_file->getFileUri()); 