


Migrate node with paragraph
I’m trying to figure out how migrating content from a Drupal 7 site to a Drupal 8 site works. I managed to understand how to create a custom module to migrate nodes with regular fields to my new D8 site. But I also have one content type where I use paragraphs.... read more
Redirect user after one-time-login
When users get an email with one time login link, they will arrive on a page to set their password (separated form via Password Separate Form) But once they click submit, it doesn’t redirect them to the normal view of the profile page. How should I make the... read more
Can’t find the cause of this error
I am working through a Drupal 8 module building exercise from YouTube and I am not able to figure out what is causing an error. The relevant page loads and displays the form but I get the following error message: Notice: Trying to get property of non-object in... read more
How to add the view name as body class
function THEMENAME_preprocess_views_view(&$variables){ $view = $variables[‘view’]; if($view->name == “YOUR_VIEW_NAME” && $view->current_display == “MACHINE_NAME_OF_VIEW”){... read more
How do you get and submit a webform in React?
I am planning to build a Drupal 8 site fully decoupled using Gatsby (a site generator for React). So I will use Drupal only to structure (content types, paragraphs), enter and update all the content and data and use React for the frontend. The website also needs a... read more
How to show contextual links / quick edit links for blocks
I’m building a Drupal 8 template/theme from scratch, and it is not showing the contextual editing options for my blocks when I view a site page. I.E., the little circles that are clicked to see options like “edit view,” “configure block,”... read more
Custom Page routing
I created a custom page type called ‘Angular page’ and a custom twig template for it which loads my angular scripts and prints the <app-root> tag. I set the page URL to /angularpage and the page will display the data correctly. The issue is –... read more
Is the homepage considered in_active_trail?
I’m learning Drupal 8, so still very new to it. I’m working on customizing the main menu. I’ve been able to add Twitter Bootstrap to my custom theme. I’ve made a custom menu–main.html.twig file. I’m trying to change the... read more
Migration Plus entity_lookup fails
Drupal version: 8.7.1. Used modules: Migrate Migrate Plus Migrate Tools Migrate Spreadsheet I’m trying to generate a taxonomy term if this does not already exist. the migration file: … source: plugin: spreadsheet columns: … –... read more
How do I change the Views (Entity Reference) filter via AJAX?
I have an entity form that allows an admin to select a content type (checkbox) and an autocomplete field that is tapped into a VIEWS Entity Reference (via the Reference Method). Goal: What I would like is to have the views entity reference filter dynamically change... read more
Prompt user to download file via AJAX form submission
I have a file that is generated when an AJAX button is clicked. I want to immediately have a file download prompt come up. The file is being generated and has the correct data in the file. I just don’t know how to force the download prompt to come up. Edit#1 I... read more
How to use t() function in controller?
I understand Drupal 8 ControllerBase implements StringTranslationTrait so we can use $this->t() in Controller class. But I found in Drupal 8 examples code, they setStringTranslation to use t() function. Here is the code. public static function... read more
Add target blank to an image link
How do I add target=’blank’ to a href in a Drupal 8 custom module? Below I have the image being wrapped by the uri. I don’t know how to add target=’blank’ $element[$delta] = array( ‘#theme’ => ‘image_formatter’,... read more
Facet – default value with search api
I am using content type in Facet. The search result will be having an option to choose the content type to filter the result. I want the search should show the result with particular content-type filtered by default. Is it possible? If so, how to do that? To be little... read more
Drupal 8 and the Configuration API – an in-depth look
I’ve written a five part blog-series on the Configuration API, to help Drupal developers understand what it is, how to effectively work with it, and various modules that extend the API with their use-cases. Drupal 8 Configuration: Part 1 – The... read more
How to get and apply current page query parameters from current AJAX request
I’m having a hard time figuring out how to do this. Essentially I have a table displaying users on a page. The table is paginated with the PagerExtender and sortable with the TableSortExtender. Each user row has links with “use-ajax” classes; these... read more
Error when upgrading to Drupal 8.7.1 on module menu_link_content
When running database updates (on domain.com/update.php) from 8.6.15 to 8.7.1, I got the following error: module menu_link_content Update make_menu_link_content_revisionable Custom menu links have been converted to be revisionable. Failed: InvalidArgumentException:... read more
Compony: An opinionated approach to bring cutting edge Front-end to Drupal
We just launched Compony! An open-source platform to bring the Frontend of Drupal 8 to new heights! 🔥 A component-only theme 👩💻 A hand-tuned Gulp 🌈 A Frontend Drupal platform for themers and designers to collaborate 👊🏾 For more information, check... read more