Custom Query Code for Views to Optimize Site

Hi! Some of my site that contains a lot of content is taking up to 26 seconds to load. I think it's because the query it's running through to filter the users is super inefficient. How can I add custom code to refine the query results...I'm trying to speed up the site as a whole, and sorting through and displaying the views is the only part of the site with this problem occurs. I've read into the hook function, but I'm still a little new and confused as to how to write the custom code and put it into the site. Help please!

Edit view field with preprocess hook

I have the following drupal hook.

$variables['output'] before hook: 1111111

$variables['output'] after hook: (304)111-1111

$variables['output'] when view is rendered: 1111111

Taxonomy reference field in custom form

Hi,

How can I set the taxonomy reference field to a custom form in Drupal 8 programatically?

I appreciate your help.

Error in .install file. Problem in installing custom module

Hi,

I have created a custom form which stores the name of the book and the type of the book. I have created the mymodule.install file but I cant install the module. It shows the following error,

Notice: Undefined index: :normal in Drupal\Core\Database\Driver\mysql\Schema->processField() 

I have pasted the .install file, please let me know where the syntax error is:

<?php

Custom module installation error

Hi, 

I have created a form to store the book name and the book type. I have facing some errors with the .install file. Whenever I am trying to install the module, the following error shows up:

Notice: Undefined index: :normal in Drupal\Core\Database\Driver\mysql\Schema->processField() 

The following is my .install file code

<?php

/**
* @file
* Install, update and uninstall functions for the mymodule module.
*/

How to display the parent node or product of a comment ?

I installed the Message module on my site. I created a custom module that created a message when a comment is created.

https://imgur.com/a/4OLhGlL

How to display the parent node or product of a comment with TWIG?

In Drupal tokens, there is no face-up token with the parent entity.

Here is my template for comments :

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x