× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

IFIS with AND and OR

More
8 years 1 month ago #3795 by jcollsabc
IFIS with AND and OR was created by jcollsabc
Hi There,

I'd like to use IFIS but check against more than one condition.

Is it possible to use AND and OR with IFIS?

I can create a helper column in the DB to check against but I think it would be more powerful if we could use AND and OR. eg

{joodb ifis|field_cost|100|gt|AND|field_cost|lt|200|AND|field_published|true}
stuff
{joodb endif}

Please Log in to join the conversation.

More
8 years 1 month ago #3798 by Dirk
Replied by Dirk on topic IFIS with AND and OR

jcollsabc wrote: {joodb ifis|field_cost|100|gt|AND|field_cost|lt|200|AND|field_published|true}
stuff
{joodb endif}


currently AND or OR constructions are not possible. To be honest the construction you propose seems to be to complicate and inflexible. What would you do if you have a mixed AND and OR construction like {joodb ifis|field_cost|100|gt|AND|field_cost|lt|200|OR|field_published|true}

Your construction can also be archived like this.
{joodb ifis|field_cost|100|gt}
 {joodb ifis|field_cost|200|lt}
  {joodb ifis|field_published}
    .... output ....
   {joodb endif}
  {joodb endif}
{joodb endif}

The Output within the three conditions will only display if all conditions are true.
Maybe future versions will have an option for multiple conditions.
The following user(s) said Thank You: jcollsabc

Please Log in to join the conversation.

More
8 years 1 month ago #3799 by jcollsabc
Replied by jcollsabc on topic IFIS with AND and OR
Thank you for this. I can see it could get quite complicated with a built in function.

Thank you for the example as well. I'm not quite sure how the OR works though, seems like it is acting as an AND.

If you have the time could you provide an example with just an OR

{joodb ifis|field_published} OR {joodb ifis|field_live} Which would return an output if one or both are true.

Thanks

Jonathan

Please Log in to join the conversation.

Moderators: Dirkjoest