We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [drop-down]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
42 views

Craft 3: fetching a single Matrix row by its dropdown field value

I have 2 Matrix fields in an entry type, both of which use Dropdown fields: Matrix: urls address (block type) context (dropdown field values include 'own') address urn ...
3
votes
1answer
64 views

Math with numeric values derived from a dropdown field

I had a dropdown field with a handle of hLevel, with only numeric values in it, anticipating that I could do math with the values in my template. But it seems I can't. {% set dif = subhead.hLevel - ...
1
vote
2answers
83 views

Dropdown field value getting outputted multiple times

I have a dropdown field that has three options. In my template, I want to do one thing if option 1 is selected and do something else if option 2 is selected. Here is what my code looks like: {% for ...
3
votes
1answer
110 views

How to print all possible options of a dropdown field inside of a Matrix field?

I'm asking this outside an entry context. My starting point is {% set field = craft.app.fields.getFieldByHandle('matrixFieldHandle') %} When I print the data of the field, I find nothing ...
2
votes
1answer
51 views

LJ Dynamic Fields - Only Seeing Latest 100 entries

I am currently creating various component entries (under channels). Once created I can then add that specific component to structure (know on my site as a work page). On the work page I have a ...
1
vote
1answer
191 views

Translatable dropdown menu

Does anyone know how to make the dropdown field translatable? I'm working on a site which has both English and German languages, but whenever I set up a dropdown field it only ever appears in English ...
1
vote
0answers
55 views

Show Images via Dropdown dynamically

I am currently working with craft. I want to create a filter with a dropdown list that will only display the images, that are related to the selected dropdown. Is that even possible? What I have: ...
1
vote
1answer
138 views

Is it possible to use an existing field into a matrix?

I'm trying to reuse a dropdown field inside of a matrix. I've already created a field which has hundreds of dropdown values. I want to be able to select from this dropdown field for each item of a ...
1
vote
1answer
87 views

Use value of a dropdown field for an `include`

I'm trying to have this include be updated by the option I choose in my dropdown. {% include 'subnav_programs.html' %} My dropdown is called entry.dropSubsection I put {% include '{{ entry....
1
vote
1answer
20 views

error when trying to loop through grouped entries according to dropdown field

I was trying to follow this example from stack overflow to loop through a list of entries and output them by a custom dropdown field {% set allEntries = craft.entries.section('resource').find() %} {% ...
2
votes
2answers
310 views

Front End Form with Dropdown in Matrix - Adding New

I've got a Matrix field called Emergency Contacts (handle: emergencyContact) that I'm setting up so that users can add/update on the front end. It has one block type - contact - with 4 fields: Name (...
1
vote
1answer
49 views

How do I eager load a dropdown field?

I'm going through my current project and making my loops more "eager". It's working great in several areas and improving performance massively but for some reason I can't get it to work when the ...
1
vote
1answer
96 views

Add Checked Attribute to Custom User Fields on Frontend User Form

I have a multi-select for users to sign up for newsletters. When they edit their profile they need to be able to see which newsletters they are already signed up for. I have the code to output the ...
2
votes
0answers
45 views

Retain value from select and checkbox on frontend form after failure

I have a registration form on my frontend and when people click register but the form fails (due to the username already existing for example) I would like to keep all info they entered in the form so ...
1
vote
0answers
117 views

Submit Dropdown with ajax

This works for me, but i would like to solve this with ajax without reloading the page. Choosing the values from the Dropdowns and submit the data per POST Method, so i can return the value with "...
2
votes
2answers
237 views

How to create a user editable dropdown field?

Trying to figure out the best way of handling this scenario: We have a data field for a entry type that should allow an editor in the CP to select one option from many (ie. a dropdown). However, we ...
2
votes
1answer
897 views

Select dropdown not going to option url

I have a pop up box on a siteplan image that includes a select dropdown to let people select the apartment that they want. However, I can't get the it to go to the url when it's selected. So need some ...
1
vote
1answer
334 views

Reuse chosen dropdown field value on frontend

I would like to choose entry values from a frontend dropdown and reuse the chosen value directly. {% set entries = craft.entries.section('mountainbikes') %} <select name="year"> {% for entry ...
1
vote
1answer
258 views

Drop-down and checkbox in a condition

I'm new to Twig, and I'm struggling to compare a value from a checkbox with a value from a drop-down {# sourceCountry - checkbox with a list of countries #} {# currentUser.country - dropdown ...
1
vote
2answers
314 views

Simple Search form with a few drop-down choices

Looked at countless examples here but all seem to be more than I need. I need the form to have three drop-downs Make -Ford -Chevy Color -Red -Blue Transmission -Auto -Shift And the search results ...
1
vote
1answer
28 views

How can I get spaces to render in my dropdown option label template call?

Example Let entry.dropdownOption.label = "option with spaces" {% for entry in entry.dropdown %} {{ entry.dropdownOption.label }} {% endfor %} renders as in my template: "optionwithspaces" How ...
3
votes
1answer
116 views

Calculating a score based on a drop down field value

I am storing a value (number 1-5) in a drop down field and would like to do a calculation based on the numbers filled in. The only way I could get my calculation to work was to store the number (1-5) ...
2
votes
1answer
405 views

Dropdown field 'default'

I have a field of the dropdown fieldtype, let's call it myDropdown. myDropdown has a list of options, one of which has the "default" checkbox checked. If I use a front-end form to submit a new ...
2
votes
2answers
160 views

Using a Dropdown field in a Matrix to parse a global

I have two globals setup for affiliate and compensated type language - using Matrix and a dropdown I'm trying to find a way to let the user add this language in a new block. I cannot for the life of ...
0
votes
1answer
208 views

How can I get the correct label of a dropdown that has matching values?

I have a drop-down field in the CP - It represents a range of numbers that are based either a percent or a fixed number. For example, a choice could be Fixed 5% or a choice could be Variable 5% In ...
1
vote
1answer
152 views

Find Dropdown Option Labels That Are Assigned in a Section

I can get a list of option labels available in a dropdown field using the code below. Is there a way to get a list of option labels that have been assigned to entries in a specific section? {% for ...
2
votes
1answer
768 views

Craft Request Filter Query Matching Drop Down Fields and Checkbox Fields

I have a front end form that allows users check checkboxes to find entries that have matching field values. I've pieced together a query reading other posts here and my limited knowledge of Craft and ...
0
votes
1answer
425 views

How can I populate a dropdown via table field type using the default values?

In the CP I have a table field called colors. I have two columns, "Label" and "Value". I have populated the table with two default values "Red" and "Blue" (attached). This table will ultimately ...
2
votes
1answer
153 views

How can I merge entry values to create a select dropdown

For the life of me I can't seem to find an answer for this question, so here goes! I have a field called jobCounty in a section called jobs. The jobCounty is selected in the CP from a drop down list ...
1
vote
1answer
413 views

Front end entry form drop down field

I'm trying to update a drop down field type on an entry using a front end form. However, the input is a hidden field (not a select) This is the form code I have so far: <form method="post" accept-...
1
vote
1answer
1k views

Conditional if statement for Matrix dropdown option

Ok, so I've tidied up the code a bit and using option.selected instead of option to see if the option is selected. But, it isn't behaving how I'd expect it: {% for telephone in user.profilePhone.type(...
3
votes
1answer
468 views

Dropdown empty option

in order for my client to have the choice of selecting options or not, I entered an empty (blank) option in a dropdown field. In the frontend, I use this code: {% if entry.dropdownFieldHandle|length ...
0
votes
1answer
375 views

Navigation drop-down problem

Doing my first site with Craft and UiKit framework I encountered a small problem with dropdown menu. Here is my code: <ul> {% set entries = craft.entries.section('spb') %} {% nav entry in ...
2
votes
3answers
2k views

Display list of countries in form using a dropdown

So I'm using this territories plugin to display a list of countries in a dropdown. The issue I'm having is showing these countries within my front-end entry form. I've used this example but it doesn'...
1
vote
1answer
551 views

How do I add an HTML tag to the formatting drop-down in the rich text editor?

I would like to add the 'code' tag to the formatting drop-down. My rich text field is using Standard.json and I am able to remove the current tags, but it's not letting me add additional tags. I have ...
1
vote
1answer
348 views

Outputting Navigation

I need some help with coding the navigation. This is the markup: <ul> <li class="active"><a href="#">home</a></li> <li><a href="#">about</a>&...
5
votes
1answer
1k views

How do I output a dropdown's values if I'm on a registration form not tied to an entry?

I have a registration form on my website. All of the fields here so far have been text, which is no problem. However, I've just been asked to create a dropdown box for users to select their salutation ...
15
votes
2answers
3k views

How do I create a locale dropdown to switch between languages?

I’m trying to create a dropdown menu to switch between language’s on my site. I am currently doing this with this snippet found on the google plus community: {% block locale__switch %} {# Loop ...
5
votes
2answers
404 views

Is there a way to populate a drop-down with the templates files in a folder?

When I have a folder setup for template partials, is there a way I could automatically populate a drop-down with the list of templates in that folder? This would be useful in the case where I have a ...