Set cookie inside webform handler

Set cookie inside webform handler

Following up with my previous question, I need to set and retrieve a cookie in two difference places: set – inside postSave() in a Webform handler get – inside an event subscriber. In looking around, it seems that there are a few different options for... read more
Set cookie inside webform handler

Display node local tasks on custom page

I’ve created a custom route for each nodes, let’s say /custom-page/{node}, which renders some specific stuff from a Controller. On this custom page, I’d like to automatically display the same local tasks as displayed on nodes canonical pages (In my... read more
Set cookie inside webform handler

How do I hide the core version to the outside world?

I was bothered in knowing with whatcms.org a version can be given for drupal 8, even a minor version – no minor version, instead, when I tried with a drupal 7. Curiously enough in my case, I got a version slightly newer (just one minor version ahead), but... read more
Set cookie inside webform handler

Create Custom Select Webform Element

I asked this last time with ‘Select Other’, but I am still not understanding how to change custom element’s type. In this scenario, I am attempting to build a Select type webform element. I am reusing the Webform Example attached to the webform... read more
Form API placeholder attribute rendered as "- Select -"

Form API placeholder attribute rendered as "- Select -"

In a custom Drupal 8 module, I have a couple of Form API fields of ‘#type’ => ‘select’: $form[‘form-right’][‘field_role’] = [ ‘#type’ => ‘select’, ‘#title’ =>... read more
Set cookie inside webform handler

How do you target a specific type of content?

I have the content type (node), article, page, recipe. The code below can be used to flag any type of content. How do you target a specific type of content ? For example I only want to flag the article and recipe content type. <?php /** * @file * Holds hook... read more
Set cookie inside webform handler

Require v8 only contrib module with v9 patch

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has a working v9 patch in the issue queue is there any method to install... read more
Set cookie inside webform handler

Updating core to 8.9.6 fails

I’v installed Drupal 8 by composer. Everything worked fine, but when I tried to update core from 8.9.1 to 8.9.5 in ended up in 8.9.4. Today I tried to update from 8.9.4. to 8.9.6 by changing composer.json to demand v 8.9.6 at least. The result was following... read more
Set cookie inside webform handler

How do I properly use hook_preprocess_views_view_unformatted()?

I have the following hook in mymodule.module. function mymodule_preprocess_views_view_unformatted(&$variables) { $view = $variables[‘view’]; $rows = $variables[‘rows’]; if (in_array($view->id(), [ ‘my_view’, ] ) ) { foreach... read more
Set cookie inside webform handler

How do I install core on Windows 10 with Nginx server?

I Want to install Drupal 8 on Windows 10 with nginx server. I do know how to install with Apache using XAMPP. I use PHP 7.2, Microsoft SQL as the db. I installed nginx 1.18.0 and PHP in C:/ I connected them with php-cgi -b 127.0.0.1:9000 my root file for the server is... read more
Set cookie inside webform handler

Cloudflare Clear Cache For One URL, Convert Curl Command to Drupal::httpClient() Or php

I am creating a custom module to clear caches on cloudflare for one url. The original curl command: curl -X POST "https://api.cloudflare.com/client/v4/zones/123456789/purge_cache" -H "Authorization: Bearer 123456789" -H "Content-Type:... read more
Set cookie inside webform handler

Send email to Commerce customer after order status is changed to Completed

I am attempting to develop a module that will send an email to a customer in my Commerce 2 store when that customer’s order’s status is updated to "Completed". I am basing my module off of the example shown in the handbook... read more
How can I get Slick Slider to display the images?

How can I get Slick Slider to display the images?

I have a "test" content type with a title, body, and a media entity field that allows for multiple images. I installed Slick Slider 2.2. I mostly followed the steps outlined here:... read more