Page 1 of 1

add generated column to table view with a hooks file?

Posted: 2025-04-08 05:58
by cnaome
Hello

Is it possible to generate an additional colomn in the table view using a hooks file?

I added code to the init() function. I can see the column but there is no data (in any of the columns...) My SQL code gives a result in the database.

I added my new column to:

$options->QueryFieldsTV
$options->ColFieldName
$options->ColNumber
$options->ColWidth

I can do this with a view but I wonder if it possible with a hooks file? If so, what are the steps to make it happen?

Thanks!

Re: add generated column to table view with a hooks file?

Posted: 2025-04-10 19:19
by pbottcher
Hi,

from my knowledge, you need to adjust the template used to generate the TV, otherwise you will be able to add a column, but no data will be displayed.
Maybe you can explain what you try to achieve. Why cant you just add a field to the table?