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

PHP include function in drupal 8

Hi everyone

I am currently using drupal 6, planning an upgrade to drupal 8 or 9.

I am using the PHP module now but plan to ditch it.

In my content (written articles) are inserted google ads.

The code for the google ads is in a file named adsense-central.php and i call it within my articles by using the php function :

<?php include("./adsense-central.php");
?>

How could i continue having my adsense code located in a single file for easy modification and calling that code to my content without using PHP module?

Import data from CVS file and create or update existing entity created using ECK module

Hi

i have created 4 entities using ECK module in drupal 7 (candidat, subject, ...)

what i need is to crerate custom module import cvs file and when i imported my data i would like to updated existing data in all entites like for exemple candidat whene i import first and last name of candidat i would like to update cnadidat if existing if note create new one

can i do that for other entities in one module code

How to log error without specific module reference

I want to write to error log on a Drupal 9 installation. I need to get the log for a specific condition to solve some errors that hit "core/install.php" drupal resource, due an unknown condition.

I noticed that in Drupal 9, I can use:

\Drupal::logger('my_module')->error($message);

Given the fact that I don´t know the module´s name, how can I add an entry to error log (using \Drupal::logger or another alternative)?

Sincerely,
Teresa Fleming

After update custom module show no changes

Hello I'm new in drupal, I have a problem with drupal 8.8. The site has a custom module, to obtain data from an API. After editing the source code of it. Clear the cache, restart the server and manually execute the cron, but still the changes are not observed, do I need to do something else? What i'm doing wrong?

Message with modal window

in a form after checking on the user I would like to display a msg with a modal window, so that the user is forced to read and then move on.
I currently use \Drupal::messenger()->addMessage()

how to change menu item from unordered to ordered list

I am very new to drupal and trying to find this solution using hooks. i have to find a way to change unordered list item to ordered list items

Pages

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