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

Handling multiple .once() actions in custom module, Lazy Builder

I have a simple jquery call in my custom module to dynamically change the css depending on the visitor. The first uses find() of a class in a header and it seems to work fine. Now, I need to find another set of elements in a sidebar but it's not working. When I first was watching it move through my function I saw that the sidebar was processed well after my script had run. That leads me to think to use .once() for both calls but the second ends up changing the sidebar height to 1px.

[SOLVED] Drupal way of storing data related to a node

I want to store some data that is related to a node and trying to figure out the best way of doing it. For example, I send emails related to a node and I want to save details such as:

  • To Email address
  • Cc Email Addresses
  • Date sent
  • User
  • Email type
  • Other chosen email options etc

In the past I would use Paragraphs to have an unlimited field but this will, over time, grow to have a lot of entries. I'm also using Revisions on the node so I think this will slow everything down when saving the node.

Node save slow with a field containing lots of paragraphs

I have a node that has a Paragraph field. It has around 80 Paragraphs referenced to it. When I save the node programmatically it's very slow. It seems like the slow down is happening in the preSave() of the field. I'm wondering if every referenced Paragraph is being loaded when the node is being saved?

Could it just be bad design by myself that I created a node that has a field with 80+ Paragraphs referenced to it? Or is it legitimate to do it this way?

I should add that the node uses revisions.

Opening a route in a Modal not working

I have this route that is suppose to render a block and two view blocks and then display them in a modal.

Originally, I had this route created in the Pages section of Structure, but then decided to create it in my module using this tutorial

Create a modal from an existing URL

You can open any page in a modal from by making the link like:

<a class="use-ajax" data-dialog-type="modal" data-dialog-options='{"dialogClass": "my-modal"}' href="my/custom/page">
  {{ 'Open Modal'|t }}
</a>

You can create an endpoint that uses a controller method that responds by opening a modal like:

Layout builder override with contact form dont' work

Hello, I would like to modify the layout of the contact form and just add an image. Unfortunately, I can't do it. My block is well created, there are two options, I select both and in custom display settings, I created a custom mode view. 
I can't do it. I have just tested layout builder for articles for example and there no problem but for the contact form I can't do it. I followed what is written in the layout builder documentation, however.
Does anyone have an idea ?
Thank you very much for your help.

Pages

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