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

[Solved] Add simple text field to custom module

I am a noob working on my first module, and I've hit a wall pretty quick. I've got a controller which generates an NxM table where N and M are passed in via the url. I want to add some simple textfields to the header row of the table, but the purpose of the textfields is not for collecting data, but rather for the user to print out the table with their nicely typed header information.

If I create this in pure html, I simply add an <input> in the table cells where needed, but I'm not sure how to accomplish this in Drupal.

Please help. Thank you.

How to show scroll bar when a form field is too long

Hi,

In my project, we have 800+ categories , when visit the article edit page /node/{nodeId}/edit , this will show all categories and the page will go very long.

I'm wondering if I can add a scroll bar at the category field, so the page won't go too long, how can I do this?

Thanks!

File workflow

Hello.

We have an Entity which manages some files, and we added a workflow to control the process (draft, published, archived). To keep files (for replication) we have the folder architecture tmp, files, archived that correspond to each step of the workflow.

Regarding Views and Rest export

Hi,

I have joined two tables in hook_views_query_alter(). But if I want to display the information stored in one of the columns of the joined tables, on making a GET request, what should I do?

Thanks,

make nodes by groups or subnodes

Hi,

i want to make nodes by groups or subnodes but i don’t  know what modules i need to use.
what i want to do is:

when user write a title of the node for ex: "john wick 3"

if there is not node with same title he must create a group of that name "john wick 3" and he will fill the informations and a picture to the group and he will add his node to that newly group

if there is a group with the same title he gets a notice that there is a group with the same title and he will add his node to that groupe 

How to dynamically create a ajax select for each item in a table.

Hello Friends.

I am trying to create shopping cart functionality via a custom module.

I send the cart items from my controller to my twig template using the following code.

MainController.php 

 // get the cart items and send them to twig template
 public function loadCart() {
        $data = $this->db_logic->getCart();

        return [
          '#theme' => 'cart',
          '#title' => false,
          '#data' => $data,
        ];
    }

cart.html.twig

Pages

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