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

using #states in form_alter on node form

All of the documentation and examples I can find say you should be able to set the '#states' key in the top level array for a field in a node form from within a hook_form_alter() implementation. Like

Hook with Webform Drupal 8

Hello

I am using Webform module and I want to have a custom thank-you page. In my webform settings (called 'test-form') : Administration > Structure > Webform > Confirmation type, I have selected Inline.

But I have created a hook because I want the webform to redirect to a specific thank you page based on their submissions and I want to send the data using Rest API.

Unfortunately, it doesn't work, I have the impression that the confirmation type in the settings overwrite the redirect in the hook. 

Here is my custom module code:

Drawing bars

We're writing a custom module that needs to create a horizontal bar graph.  We looked at the Charts module, but we're having to mimic a report generated by a desktop app, and  it doesn't appear that we can get everything in with that module, leaving us to try drawing would own bars.  We've put together a function on the site that will return an image of a specified color and width using GD.  The issue  we're facing is the specifications for the site must work on mobile, tablet, and desktop.  This requires being able to give the function a pixel width based on the browser window width, which

formBuilde & getForm

Hello,

(sorry for my poor english...)

I'm in a development contexte, at home, with mac / php7.1 / drupal 8.5.5 and XAMPP.

In a controller, i build a response for user, with value and form. To resume :

[..]

$parameters = array("nodeid" =>$nid);
$form = \Drupal::formBuilder()->getForm('Drupal\module\Form\theForm',$parameters);
$build['contenu']= ['#markup' => $contenu];
$build['contenu']['form'] = $form;
return $build;

like that, i have values with at the end a form to choose a person.

Returning BinaryFileResponse to Custom Block

Alright, so I have a custom block that is implements a build() method. I also have a controller which loads in terms and should they pass certain requirements, it will return a binary file response, displaying an SVG file. I want my custom block to call this controller method and display the rendered BinaryFileResponse, but I'm not quite sure how to do this.

My block code is as follows

Editing Views HTML in drupal 7

So, i need to edit a Views block to make it unreachable trought keyboard navigation / tab focus. What came first to my mind was adding an attribute (tabindex=-1) to its first div or the anchors/buttons inside ( html4 do not support tabindex on divs), making this change directly to the html. Its possible? Would love some advice on this.

Thanks!

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions