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

Get defaultValue For a Media Library Entity in Drupal 10

I'm upgrading my theme and I use a combination of Paragraphs module and an Image Field. Previously, I had a function to get the default image. $field_name is the `field_image`:

  $field_definition = $variables['paragraph']->getFieldDefinition($field_name);
$uuid = $field_definition->getSetting('default_image')['uuid'];
$files = \Drupal::entityTypeManager()->getStorage('file')->loadByProperties(['uuid' => $uuid]);
if (count($files)) {
$file = reset($files);
return $file;
}

How to add placeholder text via twig template

Hello,

I like to add a placeholder "Enter your name" to the "Your Name" text field of the feedback form using a twig template. 

Below worked for the email field. 

File Name: input--email.html.twig
Directory: themes/mytheme/templates/form

Address module

I've been working with address module (Version: 8.x-1.12) and I've been able to figure out how to override subdivisions based off of the example (https://docs.drupalcommerce.org/commerce2/developer-guide/customers/addr...) of adding the UK counties using GreatBritainEventSubscriberas a guide.

create content on registration (html files)

Hello everybody!

I need some inspiration/advice on which way to go further.

Site: a free site for shrinks. In return I want members to paste an iframe on their personal site (SEO-shizzles, you know)

Target : (authenticated) member has a personal iframe available (content includes their name and the link links to their personal page (view) on my site)

EDIT: Sorry if this is a simple question, I've been out of Drupal since D7 !!

User Auto Login

Hello. 

I need hook/s for create an custom module for possibility for user/s for autologin.

This user/s only may see only one view or type of content.

Only for view content and view of thid content type.

With possibility of creation QR code for login. 

Not other permissions. 

Thanks 

How to use external php library

Hello

I installed the OpenTBS by composer into my drupal9 project.
https://www.tinybutstrong.com/opentbs.php

After that, apply the following code inside the controller.
--------------------------------------------------------------------------
include_once(getcwd() .'/vendor/tinybutstrong/tinybutstrong/tbs_class.php');
include_once(getcwd() .'/vendor/tinybutstrong/opentbs/tbs_plugin_opentbs.php');

Pages

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