0

I have a submissions form where I am displaying all the form submissions in a table with custom columns, which I build from my form elements I created. But also I am using an built-in drupal column called 'completed', which will display the date and time of the submissions. I need to edit this column name to 'submitted at'.

I tried theme_table and module_table methods to edit the value but I am not able to hit those methods. When I tried hook_form_alter I am not able to see the table values when I did var_dump($form) to edit them in form[] array. I kept knit(_context) in the twig file of the table and I am able to see the values of the table and the value is coming from _context->few layers Drupal\Core\Template\AttributeString.

How do I use this info in form_alter or any other hook to edit that string value?

Like I don't know how to use _context array in form_alter method. when I tried form['_context'] its giving me null.

0

I was able to edit it using theme_preprocess_table method below is the method which I used.

   function theme_preprocess_table(&$variables)
   {
       $variables['header']['completed']['content'] = 'your requirement';
   }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.