Articles Anywhere

Filter articles by two custom field conditions

5 months 2 days ago #89175

Octav A's Avatar Octav A

Hello,
I need to show articles filtered by two custom fields:
custom_field_1 = articles custom field
custom_field_2, custom_field_3 = joomla text field

When i filter by one like this:

{articles custom_field_1="this:id" limit="3"}[title]{/articles}
it shows expected result - very nice.

But when i filter by two like this:
{articles custom_field_1="this:id" limit="3" custom_field_2="this:custom_field_3"}[title]{/articles}
It does not work (request timeout)

Please advise if this correct syntax or maybe is not possible to filter like this. Thanks.

5 months 2 days ago #89179

Peter van Westen's Avatar Peter van Westen Admin

Should work... try placing the limit at the end. Shouldn't matter, but who knows.

So you want 3 articles in total that have the current article id as the value of custom_field_1 AND the current custom_field_3 value as the value of custom_field_2, right?
So both those filters should pass.

5 months 2 days ago #89182

Octav A's Avatar Octav A

Finally it works. The problem was that i wanted to show that as another custom field so it was quite a twisted loop. Thanks.

5 months 2 days ago #89183

Peter van Westen's Avatar Peter van Westen Admin

Ok 👍

5 months 2 days ago #89184

Octav A's Avatar Octav A

Very nice indeed. But if what i ask below is possible than it is just magic.
So i have these returned articles:

{articles custom_field_1="this:id" limit="3" custom_field_2="this:custom_field_3"}[title]{/articles}
and i would like to narrow the filter with one more condition. Please tell if there is any in-house solution for this:
I need that the returned articles by the above filter all have different custom_field_1, that is - i dont want to show articles with same custom_field_1.
Is it possible?

5 months 2 days ago #89186

Peter van Westen's Avatar Peter van Westen Admin

I don't really understand your request.
You are filtering by custom_field_1="this:id". Which means all the returned articles will all have the same custom_field_1 value.

5 months 1 day ago #89188

Octav A's Avatar Octav A

Sorry for missleading. Correct requirement is - different custom_field_2.
So first condition filters by articles field, second filters by second text field and i need one more condition that checks that second text field is different at all articles.
Thanks.

5 months 1 day ago #89189

Peter van Westen's Avatar Peter van Westen Admin

No, there is no way to make stuff unique in the Articles Anywhere filters.

5 months 1 day ago #89190

Octav A's Avatar Octav A

That will do, thanks for your time