Hi
For search and presentation reasons I want to combine the content of a few field elements into one field element. I believe this needs to be done via PHP as calc will not work correctly for this.
I have managed to do this successfully via a php list plugin. However as I believe that this requires the code to be run only when the button is selected manually, I have looked for a way to do this automatically. I have tried to use the PHP events plugin (running onpreload) with a similar code however I am not able to get the same results so I think I am doing something wrong. I have checked the wiki and tried various methods but I still can not get it to work.
I have tried the code along the lines of:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->update('object_table')
->set('new_php_test = XX,AA,ZZ');
$myDb->setQuery($myQuery);
$myDb->execute();
where 'XX,AA,ZZ' would be the values of the fields I am trying to get (I have tried various placeholders etc). I would want the label (not raw) values in each case.
Sorry if I have missed something.
Kind Regards
For search and presentation reasons I want to combine the content of a few field elements into one field element. I believe this needs to be done via PHP as calc will not work correctly for this.
I have managed to do this successfully via a php list plugin. However as I believe that this requires the code to be run only when the button is selected manually, I have looked for a way to do this automatically. I have tried to use the PHP events plugin (running onpreload) with a similar code however I am not able to get the same results so I think I am doing something wrong. I have checked the wiki and tried various methods but I still can not get it to work.
I have tried the code along the lines of:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->update('object_table')
->set('new_php_test = XX,AA,ZZ');
$myDb->setQuery($myQuery);
$myDb->execute();
where 'XX,AA,ZZ' would be the values of the fields I am trying to get (I have tried various placeholders etc). I would want the label (not raw) values in each case.
Sorry if I have missed something.
Kind Regards