Jonathan
  • Member for 6 years, 4 months
  • Last seen this week
2 answers
1 votes
930 views
Redirect to Different URl on validation errors in form builder
0 votes

You can use EnforcedResponseException to terminate form processing and redirect: $response = new RedirectResponse(Url::fromRoute('user.login', [], ['absolute' => TRUE])->toString()); throw new \...

View answer
2 answers
2 votes
1k views
How can I display a taxonomy term's ancestral tree on a content page?
1 votes

https://www.drupal.org/project/hierarchical_term_formatter, https://www.drupal.org/project/shs and https://www.drupal.org/project/cshs all provide this functionality.

View answer
4 answers
0 votes
463 views
How can you remove another modules events?
0 votes

Decorate the existing event as described in this article: https://matthieuscarset.com/en/blog/how-safely-override-or-extend-other-services-methods-drupal-8 In mymodule/src/EventSubscriber/MySubscriber....

View answer
8 answers
4 votes
10k views
How do I programmatically delete a reference field value?
1 votes

You can remove a particular referenced entity by id with this code: $entity->get('my_field')->setValue(array_filter($entity->get('my_field')->getValue(), function ($value) use ($id) { ...

View answer
6 answers
26 votes
25k views
How to programmatically create a custom token in a module
1 votes

In my_module.tokens.inc place two functions like this: <?php /** * Implements hook_token_info(). */ function my_module_token_info() { $info['tokens']['node']['my_custom_title'] = [ 'name' =...

View answer
4 answers
2 votes
388 views
Redirect after purchasing
0 votes

Examining CheckoutFlowBase::redirectToStep() taught me that this could be accomplished in a checkout pane like this: use Drupal\commerce\Response\NeedsRedirectException; use Drupal\Core\Url; ... ...

View answer
1 answers
1 votes
499 views
Show a different view mode depending on role
2 votes

Turns out, there's a hook for that. function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) { // For nodes, change the view mode when it is ...

View answer
2 answers
3 votes
2k views
How to alter local tasks menu titles?
Accepted answer
4 votes

I have had success with $data['tabs'][0]['entity.node.canonical']['#link']['title'] = t('Overview');

View answer
2 answers
0 votes
1k views
Loose compression for all images directly from Drupal
0 votes

Drupal core has a setting out of the box that allows you to compress all images on upload. See admin/config/media/image-toolkit. My image compression plan is to use that setting of 75% for basic ...

View answer
6 answers
23 votes
18k views
How do I alter the behavior of the form fields contained within the paragraph field?
0 votes

There's a patch for this in the Paragraphs issue queue. It adds new hooks: hook_form_paragraphs_subform_alter() hook_form_paragraphs_subform_TYPE_alter() hook_form_paragraphs_subform_WIDGET_alter() ...

View answer
1 answers
0 votes
734 views
8 How to configure add-on products in Commerce 2.x
Accepted answer
1 votes

Commerce Product Add-on now has a beta release for D8.

View answer
2 answers
2 votes
670 views
Is there a way to stop Order checkout in Commerce 2.x?
1 votes

Use Commerce's AvailabilityManager service. See https://www.drupal.org/node/2511266 and https://www.drupal.org/node/2710107 for more information.

View answer
2 answers
-1 votes
41 views
Manage profiles of "people" which might at some point become users
0 votes

Use "Decoupled User Authentication" (https://www.drupal.org/project/decoupled_auth) to treat everyone as users, even if they don't yet have login credentials. This way you have one consistent entity ...

View answer
4 answers
8 votes
9k views
How to hide the text formats help text?
Accepted answer
13 votes

AFAIK there is currently no core UI to control showing/hiding of those tips. Th simplify module, one of the D7 choices you link to, has a D8 port that may still help with this. The Allowed formats ...

View answer
5 answers
5 votes
5k views
How to programmatically create a title for a new node?
1 votes

The Automatic Entity Label module should be a good solution and has a D8 port (DEV version only for now).

View answer
4 answers
0 votes
2k views
Paragraph view reference?
0 votes

You should be able to acheive this with any module that can add a view as a field. Currently for D8: Display Suite Entity views attachment Viewfield Display fields

View answer
1 answers
1 votes
1k views
Multiple entity quickedit problem
3 votes

According to #15 of this Drupal issue having a duplicate node on the screen is enough to disable the contextual menu functionality. It's a bug.

View answer
2 answers
2 votes
509 views
rendered entity usage in "add node" form for an entity ref field
0 votes

This is actually not possible with Entity Reference views in Drupal 8, but will be soon. See View output is not used for autocomplete display.

View answer
1 answers
1 votes
111 views
Send argument to custom field constraint
0 votes

The method addConstraint allows an optional array of options to be passed to the constraint plugin. See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21TypedData%21DataDefinition.php/...

View answer
1 answers
1 votes
290 views
Provide default site uuid on install
0 votes

You can set the site uuid variable with drush, but a better solution is to use the "config_installer" module. See https://www.drupal.org/node/2583113 for related discussions.

View answer
1 answers
2 votes
986 views
How do I integrate media (e.g. attaching audio) to nodes?
0 votes

To use mp3 files with Media entity you need the additional module "Media entity audio". Alternatively, you can attach audio straight to nodes with the "Audiofield" module.

View answer
2 answers
3 votes
3k views
Autosubmit exposed filter?
0 votes

turn ajax "on", change "Exposed form style" to autosubmit, hide submit button

View answer
1 answers
2 votes
91 views
Using Exposed Form to filter by referenced entity
0 votes

It's not possible with views alone without custom code or another module. See https://www.drupal.org/sandbox/el/2698765 or D8 entity reference exposed filter for ideas on how to proceed.

View answer
1 answers
0 votes
73 views
Custom page with form
2 votes

You need to create a route, and a controller that builds the response on that route - in your case a form.

View answer
1 answers
0 votes
41 views
Working with views, better use various displays or create more views?
Accepted answer
2 votes

In the book "Mastering Drupal 8 Views" Greg Marshall suggests that there is no strong reason to prefer one or the other. He suggests using separate views most of the time, for the simple reason that ...

View answer
1 answers
0 votes
513 views
Drupal 8 Blog Autoposting To Facebook, Twitter, LinkedIn etc
1 votes

There's a framework of modules under development as part of a 'Social initiative'. See https://www.drupal.org/project/social_post

View answer
3 answers
3 votes
1k views
Syncing content between stage and prod
0 votes

There are modules that export content to code: https://www.drupal.org/project/defaultcontent https://www.drupal.org/project/default_content You may also be able to get something working using Migrate,...

View answer
1 answers
0 votes
870 views
Generating pages with multiple views based on url parameter
Accepted answer
2 votes

Create 7 different views, one for each content type. Create a block display for each view, and use block layout to put them all on one page. Use contextual filters for the block view to get an ...

View answer
1 answers
2 votes
1k views
Use a custom field with a custom entity
Accepted answer
1 votes

I'm not certain, but I think the reason why you are not given the option for the rgb widget on your field, is that your field is not an rgb field. I think you're creating a text field and calling it ...

View answer
2 answers
2 votes
1k views
Turning on aggregration causes a SQL error
1 votes

Counts only make sense when you have a group to count. You need to add a field that you want to group by and set its aggregation setting to "Group similar results".

View answer