Pass arguments to an Entity Reference field in a form

I have built a form as part of a module that contains an entity reference item; this item based on an entity reference view which has a contextual filter default of the current user.

I want to enable an override in my form to display those items associated with a different user.  In essence, I want to set the View Arguments programmatically.  However, I cannot see how to pass the argument to the widget in the form code.

Can this be done?  I've tried to hard code in an argument, and cannot see where this value is stored in the $form array.

Thanks

Onetoomany

How to calculate 7%

Hello,

I like to have a text field block where I can enter a dollar value. System will generate 7% of that value. Like count down, System should show the number starting from 1 as it is calculating.

Please advise.

Drupal 8 and preprocess node

I am trying create module, which check every nodes (type "article")  and replace some string - for example external url to something what I wish. My problem is, that print_r or var_dump after node_load is too big and I get error Allowed memory size of 805306368 bytes exhausted.

I created something like this:

function mymodules_preprocess_node(&$variables) {

$node = $variables['content'];

}

Driving global change with World Vision International

child laughing

Third and Grove worked with World Vision to build brand awareness, credibility, and most importantly, increase donations by 23% in under 3 months

World Vision International is on a mission to pull every child out of poverty. We’re building a global digital brand to help make that happen.

Sectors: 
Non-profit

Error while trying to upload a module

Hello!

I get  "Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:file:undefined" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are ... Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)"

So, I cannot upload any new module. Any ideas how to solve this?

How to display 'Sort by' filter dropdown in results section?

I have a search page that has filters on the left bar and results on the right. I want to display the 'Sort by' drop down on top of the 'Results' section. I have a custom template for the results section alone -> views-view-fields--search.html.twig. Not sure how to add the 'Sort by' drop down in this file. Any help?!

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x