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

Just put a php code in a page

I guys, I have a very basic question.

In Drupal 7 I was a very har user of php code inside a page (I know I'm a crazy dude), and this way I buid a lot of functionalities (believe me).

Now that I want to be a really Drupal developer (at my 58 years old), I can't believe that I can't have a simple way to put my php code and print on a page in a simple module.

Until now, I just see weird ways to put code in variables and return this in functions.

Can you teach me the most simple way to process a php code and print on a page on a custom module?

The page test example looks break!

Hi guys.

I'm very new here, but very old as a Drupal user (since Drupal 5).

First of all, sorry for my very bad english.

I am a very hard user off Drupal 7, but never developing modules. 

Well, I decide use Drupal 10 and finally learn modules developing.

I saw some videos and found this page, here, in Drupal.org: https://www.drupal.org/docs/creating-modules/create-a-custom-page-using-...

Threejs 3D model implementation

Hello everyone,

I am completely new to Drupal and Three.js, and I need help with implementing a Three.js 3D model in my Drupal website. I have created the 3D model using a 3D modeling software and exported it as a .gltf file format, which is compatible with Three.js.

However, I have no idea how to add the necessary Three.js library files to my Drupal website or how to display the 3D model on a web page or content type.

background color in the field

Hi, in a form I have several fields.

Some of these fields I would like them to have a background color.

I tried this code in form_alter but to no avail

function udf_form_alter( array &$form, FormStateInterface $form_state, $form_id ) {
   if ( $form_id == 'node_management_private_account_form' || $form_id == 'node_management_private_account_edit_form' ) {
     $form['field_fuel_total']['#attributes']['class'][] = 'background-orange-naut' ;
   }
}

Save searches made by user in a view

Hi,

I want to save searches made by user in a view by the hook_views_query_alter ..... after the user put tha data in the form serach in the view, i saved it in other table ( create custopm node historySerach)

it is a track I follow it or there is a drupal module ?

thanks a lot

Custom module with settings table like url alias

Hey,

I want to create custom modules with settings admin:

1- simple form ( ready did, it is simple)

2- With table and un btn for add line in this table ( like module core URL Alias): I don't find any tuto with this case.

If you have idea how can'i build this table in config settings ?!

Thanks 

Best regard

Pages

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