


Passing values to a view block
I have a page that contains 4 separate blocks, from the same view, Items block 1 – this contains a list of item titles Items block 2 – this contains a different list of item titles Content block 3 contains content unrelated to this functionality Results... read more
Exposed date filter adds a timezone offset in query
In Drupal 8, when creating a view with an exposed filter on a Date field (which is in date only mode), the resulting query removes some hours based on my timezone. I’m in the UTC+2 timezone, so a date filter of 2016-04-20 creates a query of... read more
How do I add extra/custom plugins in CKEditor?
I am copying the templates plugin http://ckeditor.com/addon/templates I put it in my D8 folder /core/asstes/vendor/ckeditor/plugins I do a ‘drush cr’ I do not see the templates plugin under available buttons in my text format How do I get the templates... read more
Feeds import dynamic author change
I use Feeds so that logged users can upload data. I need to keep track of which user uploads what. In Feeds importer ‘Settings’ you define the author, but in my case it should not be static but defined dynamically by the system. How can I dynamically... read more
How to add custom input type button in forms?
I want to add custom input type button in form. I tried following code, but it is converting it to submit type button. How can i add input type button ? $form[custom_button] = array(‘#type’ => ‘button’,’#value’ =>... read more
How to use an IF statement in node.twig
In node.twig (output for articles) I want to use the value of boolean content type field like this, but do not know how to realize this in drupal 8. if boolean content type is true { <div class=”text”> {{ content.body }} </div> else { <div... read more
Cloning site and $config_directories
On my local Drupal 8 multisite environment in sites/default/settings.php I have: $config_directories[‘staging’] = ‘sites/default/config/staging’; $config_directories = array(); Because the default direction for the configuration files... read more
Specifying parameters for block_load
UPDATE: Following Shawn Conn’s advice I was able to render a specific block changing $res_output = drupal_render($res_output); to $res_output = drupal_render($output); But I’m still unable to render a Book Navigation block. I was able to figure out how to... read more
Setting a field collection default value for a field using form
I’m trying to set up a default value programmatically to my field which is in field collection. This has proved quite hard and I cant seem to get around it. Any assistance will be appreciated. This is the code i have tried to far without any success.This field... read more
how to add a remove coupon button to commerce checkout page
I assumed this would be included in the module, but as far as i can see it isn’t. Im using the latest versions of Commerce, Rules, and Commerce Coupon. I want a “remove” button next to the added coupons in case someone wants to remove it and try... read more
File validation when the file field isn’t required
I have a Drupal 7 custom form where the image or file field is not required. When the form is submitted and no file/image has been uploaded, I get the following errors. Notice: Undefined index: storage in jobform_my_form_submit() (line 136 of... read more
How to do something BEFORE a view is updated via ajax submit button?
I have a view with exposed filters and Ajax activated. I would like to validate my exposed filters values before my view is updated by the submit button. The following code works without Ajax, but when I activate this functionalitty it doesn’t validate!... read more
Decryption failed because the HMAC could not be validated – error on Migration d2d dashboard page
I’m trying to migrate Drupal 6 to Drupal 7 with Migrate d2d module. Problem is that I get 2 errors on Migrate dashboard page: Decryption failed because the HMAC could not be validated. Migration c9b87f5afFile could not be constructed. And they are repeating many... read more
Storing data / session for anonymous user
I am working on a shop, and for the cart, i need to store items before payment. $tempstore = Drupal::service(‘user.private_tempstore’)->get(’boutique’); $tempstore->set(‘poids’, $form_state->getValue(‘poids’));... read more
Overriding views fields in twig
I want to override the default views-view-fields.html.twig so that I can display specific fields in a bootstrap layout, e.g. <div class=”col-sm-3″>{{ fields.field_name_1 }}</div> <div class=”col-sm-6″>{{ fields.field_name_2... read more
How do I grant permissions for translating block content?
I used the Block Image module to create some content. I want to give the site’s editor the permission to translate the blocks, but I don’t understand how to achieve that. Apparently, there isn’t a permission that allows users to translate a block... read more
Retrieve translated taxonomy term in current language programatically
How do I retrieve a specified taxonomy term translated (if translation exists for this term) from the current language context programmatically with D8? read more
Add conditional redirect to Views exposed filter (using BEF)
I have a view showing a select list of locations. Upon selecting a location the View shows a Google Map with the locations of the current selection. For certain items in the select list I would like to redirect away from the View to another page. I have looked at... read more