Menu Item Pre-Filters - Making my brain hurt

Status
Not open for further replies.

Tessa

Member
Hi all,

I am having troubles trying to figure out when to use "OR and AND". I can simply figure out queries and where to use parenthesis playing around in phpMyAdmin but I'm unable to do this with the Menu Item Prefilters, And I need to make tons of these menu items.

I need it to say:

"WHERE approval == "Yes" <--- this must be returned no matter the results
AND Brand = 25 <-- volkl access level (parent is registered)
AND Brand = 26 <-- volkl access level
AND Brand = 1, 2, 3, 4, 5, 6 <--- K2 access level (parent is registered)

I've tried to mix and match , but it keeps not returning any results.

Am I doing this wrong?

Basically I am trying to show a custom page where all the approvals are Yes, and to separate 2 factories from being able to see each other's data (K2 and Volkl).


Thanks in advance,


Tessa
 
Wow, what an awesome shortcut! I can't believe I've been doing it the long way everytime.

So now the "volkl access" and "k2 access" logins work fine for the page! (Thank you by the way).

Unfortunately, a Super User cannot view anything now. It returns 0 results.

So I added a new filter, "AND BRAND IN 1, 2, 3, 4, 5, 6, 25, 26 (text) Access: Special and it still doesn't work.

Am I doing something wrong?
 
AND won't help (AND = both conditions must match).
Add
"OR brand > 0"
(or id > 0, any condition which is true for all record)
 
Hi Troester, thanks, but it still doesn't seem to work when I change it to "OR".

Here is what it looks like:

AND approval = Yes (Registered)
AND Brand IN 25, 26 (Volkl Access ) (parent Registered)
AND Brand IN 1, 2, 3, 4, 5, 6 (text) (K2 Access) (parent registered)

(Changing any condition to "OR" seems to break it for the other access levels)

Still does not work for Super User. I'm not sure why I would use brand > 0 ?

I tried adding :

AND BRAND (greater than) 0 (Special)
I also tried adding "OR id > 0 " Registered..... but still no luck.​

And it still doesn't give results.

FYI I appreciate your time!
 
SOLVED!!!

Here was the conditions. Had to change the order:

AND brand IN 25, 26 volkl
AND brand IN 1, 2, 3, 4, 5, 25, 26 k2
OR brand >= 1 Special
AND approval = YES registered


Bam, works for all users!


Thank you so much!
 
The thing with the prefilters in menu items is that, compared with the prefilters in list settings, they are missing the "grouping" feature, witch makes elaborate conditions a little tricky to write.
 
Yup. The per-menu filtering was intended for simpler usage cases.

Glad you got it sorted though, Tessa.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top