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

Question about paage content rendering with Twig

Hello,

this is probably a stupid question but after several searches I did not find how to display with Twig the content of a node with a personalized display:

{{ page.content }} : Twig code for default display
node.mydisplay : machine name of my personalized display

What is the corresponding Twig code to display page.content with "mydisplay" ?

Thanks a lot !

Add simple php form to Drupal

Hello, 

I have created a php form for a client. They want to implement this in their Drupal 9 website - it's a form that looks up some values in the database and returns some results. The form code has input fields and a submit button. On submit, the form runs a query based on the submitted values and returns some results. I can supply code if necessary but this is not the problem.

How should I go about this in Drupal 9?

Drupal open link in new window

Hi, I have a view with a button to call up a module. I would like the recall of this module to take place in a new window that overlaps the current one and with different sizes
I tried this code, but it opens the ion module a new tabe and resizes the window
 

<a href="/giorni" class="button"  target="_blank" resizable=0, width=300, height=200 > GIORNI  </a>

Temporarily close and open default db connection in Drupal

I'm trying to force Drupal to close it's default db connection and then open it again for certain long running processes (downloads for instance). The problem is that we want to have wait_timeout set to a fairly low value in mysql to make use of resources and close the connection while doing larger downloads or other long running processes that doesn't need database.

How to reference image in Drupal post api

I am following Drupal guidelines to upload, and reference image in POST api to set image in a content. 

Although I can upload a image, I can not able to set the image properly. 

"field_image_article": [
        {
            "fid": 69378,
            "title": "This image is awesome"
        }
    ] 

or 

"field_image_article": [{ "fid": 69378 }] 

Not working. 

My POST api PHP code 

Views better exposed filter to filter csv data

I have a content type field which takes data in csv format , I have created a view , Now I want to create a exposed filter for that csv field to check if that particular data exists or not in the csv ( I have a csv file which contains Vin numbers of cars ) and now I want a exposed filter where I enter a Vin no and it checks if it exists or not )

Pages

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