Hot answers tagged

3 votes
Accepted

Calculating a score based on a drop down field value

When working with a dropdown in Twig, it's important to remember that you're dealing with an object (not a simple string). This is an object: {{ entry.myDropdown }} It's easy to forget, however, ...
  • 23.6k
2 votes
Accepted

Min/Max numeric search returning odd results

Aha! Another lightbulb moment. The wage field was set to be plain text. I changed it to number and things work as expected.
  • 1,999
2 votes
Accepted

How to use a Numeric Field with a Default Value

You can: 1) Write a plugin that extends Craft's native Number field type and adds the functionality you're looking for. 2) Make a feature request for a default value for the native Number field type....
  • 66.5k
1 vote
Accepted

Comparison with an integer from a dropdown list not working

You'll want to use: {% set mylevel = currentUser.level.value %} If you just use currentUser.level and assign it to a variable, then what you'll get back is a MultiOptionsFieldData class, instead of ...
  • 66.5k

Only top scored, non community-wiki answers of a minimum length are eligible