This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

ERR_BLOCKED_BY_XSS_AUDITOR

Getting following error while uploading image in the image field in the Drupal backend.

ERR_BLOCKED_BY_XSS_AUDITOR

Programmatically insert values to content with bundle

Hey Guys,

is there a way to programmatically create new content ( type content-type ) and insert values?

I can do that with this code:

$node = new stdClass();
$node->title = "YOUR TITLExxxyyy";

...

But, I created new content types like bundle to this page.

Here is the table:

'node', 'tabs_qualidade_e_servicos', '0', '36274', '103034', 'und', '0', 'xxxx', NULL

How to implement dependency injection?

Hey,

I am new to Drupal module development. I created a module and scanned it with phpcs for DrupalPractice standards, it said that I should implement dependency injection in my block. But, I am unsure of how to do it. Here is my code (block):

<?php

namespace Drupal\name_form_messenger\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;

Get menu title of grandparent based on child

I have menu tree like below format, While grandchild node updates i need to get Parent menu title. Any one have idea about how to get this done?

Parent Menu
 |_ Menu child
        |_ Menu grandchild

How to view a user's status (online, away, offline) ?

I have a site with Drupal 8.6

I want to display the status of the user on the page of his account.

How to view a user's status (online, absent, offline) ?

Here is what I added in the user.html.twig file :

<div class="bs-field-status">
<i class="user-online fa fa-circle fa-lg"></i> Online
<i class="user-absent fa fa-circle fa-lg"></i> Absent
<i class="user-offline fa fa-circle fa-lg"></i> Offline
</div>

When would drupal 8 change the output of a twig template? This seems to be happening and I'm not sure why or from where.

I have a module that's generating me feeds. The module has a twig template for each feed that handles the feed's formating.

For example:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions