This forum is for module development and code related questions, not general module support. For general support, use the post installation forum.

THIS FORUM IS NOT FOR "What module..." or module support questions-- it's for module development and code related questions.

The module development and code questions forum is intended to aid those who are developing modules or writing code for Drupal.

Please note that this forum is also not intended for "Is there a module that does..." or "I need help with module x..." questions. It's also not a place to ask developers to write your code for you. Please respect this.

Please do not post general discussions intended to target module developers. If the question you have isn't specifically related to writing a drupal module, please post it in a more appropriate forum.

  • If you you have drupal installed already and are seeking a module that does a specific task, have a question about a specific module and what it does or if it will fit your use case, please place your questions in the Post installation forum.
  • If you have a problem or question about a specific module, you should create an issue in the module's issue queue (after checking for an existing issue first).
  • If you don't have drupal installed yet, please place your questions in the Before you start forum.

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

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'];

}

Linking a custom page to an image using Views

Hi,

I have created a page using Drupal views. And I have displayed the logo field in the view settings, like this:

https://imgur.com/a/5Ywpyi0

I want to click on the image displayed, so that it takes me to a custom page. The url for the custom page has a dynamic variable : /text/{textid}/content. textid is the node id for the content.

I am trying to add the link to this image using the following settings:

https://imgur.com/a/b9L1hg7

Webform results based actions

I need to code for a questionnaire and based on the answers provided by the user, I need to display the products to the user. I understand Webform will take care of the questionnaire part, but I cannot use those results to perform my further actions I believe. So any suggestions or other modules I should check out or any help is appreciated.

geofield, kml and points

Currently on drupal 8 geofield I can create a map of locations with custom icons: no problem.  I can also create a map from a kml file.  I cannot do both with the same map.  Is there a way to derive more of the information contained in the kml file?  If I have a kml file that has both polygons (in my case routes) and site locations (with balloons and icons) the only label for each balloon is the name of the node not the name assigned to the point in the kml file.  I'm using google maps to display the map.  

Pages

Subscribe with RSS Subscribe to RSS - Module Development and Code Questions