• 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.

Using OnBuildQueryWhere

Hi all,

Some time ago I got information on how to use the OnBuildQueryWhere PHP Event to build a dynamic filter. I was able to get it to work, but had to leave it for another more urgent project. Just getting back to it and now I can't figure out how I did it<g>

Using $model->setQueryWhere['MyUniqueIdenitifer'] = "query";
with all sorts of permuations of colum name and table name + column name as well as just putting:

$model->setQueryWhere['MyUniqueIdenitifer'] = "1=2";

and there is never any filtering applied to the list.

Can someone please rattle my brain so I remember how this needs to be done?

Best regards,
Arnor
 
Hi guys,

Never mind, found it. I don't know where I found that setQueryWhere[] but the correct syntax is (as the tooltip on OnBuildQueryWhere states!)

$model->setPluginQueryWhere('MyUniqueIdenitifer',"Your Where clause here");

I am curious though exactly how unique the "MyUniqueIdentifier" needs to be. Not a big deal for me since I'm only applying this in one place and I've decided to use "ListNameIDxx" where the "ListName" is the name of the list without spaces, and then "ID" and the xx is the actual id of the list. So my unique ID is "ClientListID23"

Best regards,
Arnor
 
I am curious though exactly how unique the "MyUniqueIdentifier" needs to be

Unique doesn't really have any quantifiers. Unique means unique. If you use an identifier which is being used anywhere else, you'll overwrite the other one. But yes, your naming convention looks fine, unless you wind up with two copies of the same list on a page.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top