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

Media Images as URL in a view with bootstrap card layout

Drupal Version 8.7.5

Hello,

I'm having problems with responsive media images and bootstrap cards.
The media images oversizes the card.
So instead of the mediaImage render I want to use the media source url.
Sample code in a views custom text is something like the following:

CodeSnippet installation issue [SOLVED]

Hello,

I have downloaded this module on my website but it cannot be enabled due to the below error:

https://www.drupal.org/project/codesnippet

Before you can use the CKEditor CodeSnippet module, you need to download the codesnippet plugin from ckeditor.com and place it in /libraries/codesnippet. Check the README.txt for more information. Get the plugin here. (Currently using CodeSnippet version Plugin not detected)

Adding Tables to the database via script or function

I'm currently in the process of creating a custom module. One of the key aspects is the ability to access information from files uploaded via FTP.

One roadblock I'm running into is I'm realizing any file uploaded via FTP doesn't get recognized by Drupal or get registered in Drupal file table.

I'm doing something similar to this, but since the files aren't registered in the database, I can pull any information.

Anyone know how I can get files uploaded or deleted via FTP to get registered or removed from the database?

Control load order of custom module CSS files

I have a custom module. I want it to add a CSS that will load after my theme's css files.

I have successfully created the file, added it to a library, and called for the library in the .module file as instructed here. https://www.drupal.org/docs/8/creating-custom-modules/adding-stylesheets...

custom_style.libraries.yml

Error in loading node

Hi,

I am trying to load a node of type source_node in my hook_form_alter function:

function heritage_schema_form_alter(&$form, FormStateInterface $form_state, $form_id){

if($form_id == 'heritage_schema_add_text_toc') {
$nid = \Drupal::entityQuery('node')->condition('type','source_node')->execute();
$node_info = \Drupal\node\Entity\Node::load($nid);
print_r($node_info->id());exit;

}

}

Auto Assign User Role After Specific Form Submission

I am running on Drupal 8 and I am attempting to auto assign a role to an authenticated user after submitting a specific form. I've tried rules, but it's not up to par.

Here's the problem I'm trying to solve:

  • An authenticated user is directed to a specific Webform (this is not a registration form)
  • After the authenticated user clicks submit, I am wanting a new role to be assigned to their account so they can access private pages

I want that registered users could gain another role after submitting a specific  Webform.

Pages

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