Questions tagged [comparison]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
264 views

Compare entry date with 90 days ahead

I need to display a message if an entry is more than 90 days old. The below code doesn't appear to be working, any tips on how to get this done? {if {current_time} > {entry_date} + 7776000 } &...
0
votes
1answer
72 views

Conditional Comparison Operator Not Working With Snippet

I am trying to get a snippet that calculates a value and compare the result to a number - the value is correctly outputted from my snippet when I include the var by itself. However when I use the ...
1
vote
1answer
106 views

Compare contents of two grid inputs, possibly with variables?

I have two grid inputs and I need to have a conditional statement that says: if all fields of both grids are equal to 0, output some text. The way I'm trying to do this is by changing a variable value ...
2
votes
2answers
68 views

How to only execute some code within a specific time frame?

I have a site where users can use a SafeCracker form to submit an entry. Once they submit the entry, they are taken to a confirmation page that also includes some code to automatically send out a ...
0
votes
1answer
158 views

Compare a get variable with a path of categories

I have a series of if:elseif statements that compare $_GET Variables using "{exp:parameters:get name='price'}"=="<?php echo $myVariableHere; ?>". This is filtering out some of the entries so ...
2
votes
1answer
2k views

How do I compare date values?

I would like to create a conditional based on the value of a date field compared to today's date. In English it would be: if Expiration Date is less than today's date set class to "expired" Here is ...
0
votes
2answers
94 views

How can I compare the categories assigned to 2 different entries?

I'm trying to compare two entries from two different channels and see if they share a common category. Each entry can be assigned to a number of categories. Both channels use the same category group. ...
1
vote
3answers
124 views

Channel Field Date: Ignore timestamp during comparisons

I have a channel field named start of campaign and one named end of campaign. I want to make do a conditional that says if today is equal to or later than the start of campaign AND today is before ...
26
votes
7answers
6k views

Difference between quoted and unquoted comparison syntax

In general, when comparing variables in templates, I use unquoted variable names. e.g., {if segment_3 == category_url_title} If comparing to an actual value (not a variable), I quote the value. e.g.,...