How to inject code into node body after x paragraph

How to inject code into node body after x paragraph

Trying to figure out if there is a way to inject code after the first or second paragraph on a node. More specifically I am trying to inject an Adsense ad. So far I haven’t been able to find a solution or module that will do this. Can anyone help? I am not using... read more
How to inject code into node body after x paragraph

Workflow, Workflows, Workspace, and State Machine– what is the difference?

Drupal 8 core has an experimental module called Workflows. There is also a contrib moduled called Workflow. There’s also the Workspace module, which is associated with the Deploy module. Commerce 2 uses State Machine, another module that provides workflow... read more
How to inject code into node body after x paragraph

custom js in bootstrap sub-theme is loaded, works in console, but doesn’t actually work in browser

I have a bootstrap subtheme with scripts[] = script.js in the .info file. When I go to the site and view html source of the page I can see that drupal is including the file <script src=”http://site/path/to/subtheme/script.js?ox2bif”></script>... read more
How to inject code into node body after x paragraph

How do I check if an image field is empty in a template file?

I am trying to check if the user_picture field is empty using the twig template, but I am not able to do this. I tried lots of ways:- {% if node.user_picture.value %} {% if node.user_picture.entity %} {% if content.user_picture.value %} {% if... read more
How to inject code into node body after x paragraph

Migrate row data into text formatted long multiple

I would like to import 3 different row values into a multiple text formatted long field. This is my migrate (plus) map yml: … field_mytext_formmated: plugin: get source: – dataValueA – dataValueB – dataValueC … The data is being migrated... read more
How to inject code into node body after x paragraph

File name transliteration

I need to clean up file names on upload. Both for image fields, other file fields and IMCE file manager. The transliteration module is not yet ported to Drupal 8 and the community does not seem to agree on how to implement the core transliteration in Drupal 8. Do I... read more
How do I set up a More Link in a View’s Pager?

How do I set up a More Link in a View’s Pager?

I have a View and am using the Pager to display a specific number of items, limited to 4. I want to create a “More” link to link to the rest of the items. I’ve set my view up as such: But no More link is appearing, even though I have more than 4... read more
Add popup within the ckeditor dialog box?

Add popup within the ckeditor dialog box?

Here is the scenario. I had added a custom plugin in ckeditor. The plugin provide a button on the editor menu and when we click on that button ckeditor dialog box opens up with a text field and and a link attached to it. Now, when I click on the link a form with some... read more
How to inject code into node body after x paragraph

How do I show the publishing date instead of the creation date?

When I create an article and I don’t publish it, so I could edit the article later and publish it when it’s finished, I notice Drupal shows the creation date, not the publishing date. Is there a way to change it so the items on the front page show their... read more
How to inject code into node body after x paragraph

How do I connect to Adsense Account?

I have to add a script section to the head section on the website. I am modifying the html.html.twig file like this: <!DOCTYPE html> <html {{ html_attributes }}> <head> <script async... read more
How to inject code into node body after x paragraph

How to get order information on the checkout complete page?

How do you get the order information such as user’s name, address, e-mail and products he ordered, on the checkout complete page on Drupal Commerce for Drupal 7? read more
How to inject code into node body after x paragraph

Drush command terminated abnormally

I’m using https://github.com/drupal-composer/drupal-project and get an error when starting drush: [~/public_html/drupal]# alias drush=”~/.composer/vendor/bin/drush” [~/public_html/drupal]# drush [error] Drush command terminated abnormally due to an... read more
How to inject code into node body after x paragraph

How do I set up HTTPS on a multi-site?

I made a couple websites on a drupal multisite setup.. and I want to start using https. And.. I’m just lost. Can anyone help me get started? So, here’s the details of how I have things set up.. So I have like a drupal 7 install on ubuntu, with 3 sites..... read more
How to inject code into node body after x paragraph

Form alteration is not working from within my form class

I am following https://www.drupal.org/docs/8/api/form-api/introduction-to-form-api for my hello world module. Below is my code namespace Drupalhello_worldForm; use DrupalCoreFormFormBase; use DrupalCoreFormFormStateInterface; /** * Implements an hello_world form. */... read more
How to restrict group node access to a user/member of an group?

How to restrict group node access to a user/member of an group?

I am using the Group module and I have created a group called “Group-Y” and group type “Group-type-Y”. I also defined a group role name “Admin”. Added an member with role “Admin”. I have checked this module, which... read more
How to inject code into node body after x paragraph

Why is migration lookup failing during synchronisation of Group entities?

On the basis of an RSS feed, I am required to create Group entities and Users out of the feed’s items. Each item contains sufficient data: <item> <id>123</id> <title>An example</title> <description>Some... read more
How to inject code into node body after x paragraph

Can’t install modules from UI when site placed in subdirectory

I have Drupal 8 installed in a subfolder (www.example.com/drupal), and I have my root .htaccess configured to mask the subfolder (i.e. the URLs resolve to www.example.com; /drupal does not appear in the URLs). Everything works great except when I try to install new... read more
How to inject code into node body after x paragraph

Map or Edit Query String Values in Views?

As part of a port of a non-Drupal site to Drupal, I need to map a url query string to filters. For example, if I have this query string and slect filter selected on Site A (Non-Drupal) Site A Value 1 | Value 1 Value 2 | Value 2 Value 3 | Value 3... read more
How to inject code into node body after x paragraph

How do I use the states API in a hook?

I’m trying to use the states API in Drupal 8 but I’m having trouble, and I’m also having difficult debugging. Use case: On user accounts, I have a taxonomy term reference field called Gender. The three terms in the taxonomy vocabulary are female,... read more
How to inject code into node body after x paragraph

Load disabled items in a menu

I load my main menu programmatically with the following code : $menuTree = Drupal::menuTree(); $menuTreeParameters = $menuTree->getCurrentRouteMenuTreeParameters($name); $menuTreeParameters ->setMinDepth($minLevel) ->setMaxDepth($maxLevel); $tree =... read more