• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Design Customization » Multiple values in the conditional? (How can i select multiple values in the conditional?)
Multiple values in the conditional?
MitzZa1349
Posts: 22
Reputation: 0

Message # 1 | 8:20 AM
How can i select multiple values in the conditional?

Not working
Ex: <?if($FILTER1_VALUE$='5120X3200' and $FILTER1_VALUE$='4000x2500')?>
Ex: <?if($FILTER1_VALUE$='5120X3200' && $FILTER1_VALUE$='4000x2500')?>
Ex: <?if($FILTER1_VALUE$='5120X3200' or $FILTER1_VALUE$='4000x2500')?>
Post edited by MitzZa1349 - Wednesday, 2015-06-03, 8:57 AM
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 2 | 3:38 PM
MitzZa1349, when comparing values in boolean logic we use the "==" operator rather so than the "=" operator. Give this a shot and let me know the result. smile

Using double quotation marks is also correct practice for string comparisons - although I don't believe this makes a difference on the uCoz system it's good practice to get into the habit of it. Otherwise, what module are you attempting to compare the filter values in, and would you have a site URL?

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
MitzZa1349
Posts: 22
Reputation: 0

Message # 3 | 6:50 PM
I tried this too, with no result
<?if($FILTER1_VALUE$='5120X3200' == $FILTER1_VALUE$='4000x2500')?>

I need the multiple values because an wallpaper can have multiple resolutions (values). The website is Wallpaper HD

Checked on this image the value 5120X3200 and value 4000x2500. I would like to show the content of the conditional, only if the conditional contains both values.
http://wallpaperhdb.com/photo....-0-1030

Something like this would be ideal
<?if($FILTER1_VALUE$='5120X3200' and $FILTER1_VALUE$='4000x2500')?> --> not working
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 4 | 7:28 PM
Try the following. Also check the case of the "x" between the two values. As you're comparing a string you need to use the exact value.

Code
<?if($FILTER1_VALUE$ == "5120X3200" && $FILTER1_VALUE$ == "4000x2500")?>


Apart from that, I'll have a look into this and get back to you with a solution soon. smile

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
MitzZa1349
Posts: 22
Reputation: 0

Message # 5 | 6:45 PM
Tried, and still no answer
<?if($FILTER1_VALUE$ == "5120X3200" && $FILTER1_VALUE$ == "4000x2500")?>
http://wallpaperhdb.com/photo....-0-1030

The "X" from the conditional was the same from the values, so that wasn't the problem. But i still had to fix it smile
Please find a way if you can. Other wallpaper websites have the same filter like the one i want, and i know that it could be possible on uCoz to.

Added (2015-09-15, 6:45 PM)
---------------------------------------------
I really need it to work. How can i select multiple values in the conditional?

joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 6 | 8:18 PM
MitzZa1349, how can a filter have more selected values? "and" and "&&" say that both conditions should apply to get the required code. For this, you should use the "or" or "||" operator.

And maybe the problem is that the "X" from "5120X3200" is uppercase. It's case-sensitive, so if you put the "x" in lowercase in the filter, you should do the same in the condtion, too.

hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
Good
Posts: 360
Reputation: 12

Message # 7 | 12:38 PM
Quote MitzZa1349 ()
I really need it to work. How can i select multiple values in the conditional?


You can use IF twice.
Code

<?if($FILTER1_VALUE$ == "5120X3200")?>
<?if($FILTER1_VALUE$ == "4000x2500")?>  

your content

<?endif?>
<?endif?>
MitzZa1349
Posts: 22
Reputation: 0

Message # 8 | 10:56 PM
Quote Good ()
You can use IF twice.

<?if($FILTER1_VALUE$ == "5120X3200")?>
<?if($FILTER1_VALUE$ == "4000x2500")?>

your content

<?endif?>
<?endif?>

Tried it. Not working

Quote bigblog ()
how can a filter have more selected values?

You can select multiple values

Quote bigblog ()
"and" and "&&" say that both conditions should apply to get the required code. For this, you should use the "or" or "||" operator.

I want to show the conditional of multiple selected values of the filter. "or" and "||" are working, only if you have one value selected. I need this:
Code
<?if($FILTER1_VALUE$='5120x3200' and $FILTER1_VALUE$='4000x2500')?>content<?endif?>
I tried every combination ..
Post edited by MitzZa1349 - Wednesday, 2015-09-16, 10:59 PM
Good
Posts: 360
Reputation: 12

Message # 9 | 6:04 AM
Maybe there is something wrong in your filter value. Perhap the filter value does not work in your template you need to apply.

As I can make 4 four conditional at the same time for my site.
MitzZa1349
Posts: 22
Reputation: 0

Message # 10 | 7:30 AM
Quote Good ()
Maybe there is something wrong in your filter value. Perhap the filter value does not work in your template you need to apply.

I tested your suggestion on 2 different sites and values.

Quote Good ()
As I can make 4 four conditional at the same time for my site.

Make a filter with 4 values, check Multiple value selection:, and add an entry with all the values selected, and try again.
Good
Posts: 360
Reputation: 12

Message # 11 | 6:52 AM
Quote MitzZa1349 ()
Make a filter with 4 values, check Multiple value selection:, and add an entry with all the values selected, and try again.


As I know, an entry with 4 values but system shows only the first value in the list only.

Quote MitzZa1349 ()
I tested your suggestion on 2 different sites and values.


Does it work?

Added (2015-09-18, 6:52 AM)
---------------------------------------------
Please check your $FILTER1_VALUE$ by put them in template of test entry to see the value is.

uCoz Community » For Webmasters » Design Customization » Multiple values in the conditional? (How can i select multiple values in the conditional?)
  • Page 1 of 1
  • 1
Search: