• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

PHP events plugin for this?

jh

Member
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
 
In what way does a calc not do it? A classic use of a calc is to concatenate other fields, like ...

Code:
return "{mytable___last_name}, {mytable___first_name}";

... for a 'full_name' element.

-- hugh
 
Hi

For presentation I tried to use a calc but it was not working correctly when I moved the element order in the list. However I have now moved all the elements in a different order and it seems to work fine. Apologies that I had not worked this out.

However for search reasons (joomla search box, not fabrik search box), I wanted to amalgamate some fields as it seems that the search only returns the exact contents of a field - eg. if one search element is 'red' and another 'shirt' it will not return anything if 'red shirt' is entered. I have tried to find a different search setting but was not able to, so I have tried to amalgamate some information into one 'search field'. Hope that makes sense, and if there is another way/easier way of doing this I would be very greatful for your help.

Kind Regards
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top