I'm using Profile to add a "Department" field to user profiles.
I'm using Views to create a view of users, with "Department" being an Exposed Filter.
The Exposed Filter is a textfield. I'd like for it to be a select dropdown that is populated with all possible values.
Is anyone aware of a module that will alter Views filters, changing fields from textfields to select dropdowns?
Drupal 6. Views 2. The profile field is a single-line textfield (with autocomplete).
i had the same issue in a project
fields that are textboxes show be select box.
as attachment image shows in 'FILTER CRITERIA' choose your field
in 'Filter type to expose' part choose 'Grouped filters'
a table will be shown that you manually can add your data as options
this solution is good when you know your options
this is my RTL settings for expose a textbox filter
this is my RTL settings for expose a textbox options
and in UI - client side this field will be shown like this
What kind of profile field is "Department"? I'm assuming it's one of single-line textfield, multi-line textfield, checkbox or list selection. I only tested it with a list selection, but if you check "Force single" then the exposed filter will be a select dropdown.
Assuming you mean Drupal 6. The above is true with Views 2.x and 3.x on D6.
If you want to modify an existing filter, follow the accepted solution provided here.
If altering an existing filter does not satisfy your requirements, then this step-by-step tutorial will help you creating your own custom Views filter.
Related
I have webform module in drupal 7.23.I have 4 fields in name,email,message and publish fields.publish field is displayed only for admin user and not displayed for anonymous user.
publish field is a select option.This webform field is not available in filter criteria.
I want to save the content as draft and display only after admin review ie) have to add filter criteria for publish field in view.
Now I want to publish filter is not available for filter criteria.
I want to display the content if publish field value is 1
Let me share my findings, it works for me according to your requirement.
Webforms' Select List won't work with views expose filter as it works with content type/taxonomy. See comment by webform contributor here
To achieve that follow these steps:
1st step I created a new component in the webform named as published? with the type Select options and set its default value as "no" (because it won't show to other user it'll be empty so they can't set an value the you can't filter submissions) and check the Private check box like this
2nd step Create a views page for webform submissions like this
3rd step Add relations using Webform submissions: Data and set up like this
4th step Add filter criteria using Webform submission data: Data field field, expose it, choose Grouped filters radio option, select widget type as select and set relationship and don't save it yet
5th step For the group filter, there is table below (scrrenshort) you can add your values like you add value while creating the Publish component in webform.
I hope this'd work for you. Thank
I have a requirement to have two custom record types under parent subtab arrange in order. I used parent-child relationship but the arrangement of the child subtab is something I couldnt customize. 'test one' and 'test two' are my custom record types, and Parent is item fulfillment record.
I want 'test one' to come first and then 'test two'.
I tried adding a new Subtab via customization under translation and this order customization is not available in netsuite. Am i missing anything?
Please help.
Edit the record
Click "customize" then "customize form" in the top right of the form
Navigate to "Lists" then select "Communication"
You can drag and drop your prefered order from this screen
Name then save the custom entry form
You can then manually select this form for the record or set it as the default form
If a field is visible on the form, then it appears somewhere in the Custom Entry Form screen. Which tab it's on depends on the type of field. It could be under Lists, or Fields, or elsewhere. Look for it.
When you find it, use the Field Group dropdown to move the field between the main view and sub tabs, and drag/drop the field to change its top-down display order. The drag handle looks like ⋮⋮.
I have a Drupal view that filters on a taxonomy field. I would like to be able to toggle the filter on/off by exposing a checkbox on the Exposed Filters form.
To illustrate the problem, say for example the Vocabulary is Fruit, and the Terms are Apples, Pears, Oranges and Lemons. I can select citrus fruit content by creating a filter that says Fruit is one of (Oranges, Lemons). Now I would like to expose the filter to allow me to choose whether or not to apply my citrus fruits filter. How can I add a checkbox to the exposed filters forms that will apply the filter when selected, and ignore the filter when no selected?
This is possible:
Add a filter on the appropriate field (term reference to Fruits in
your example).
In the Configure filter criterion dialog:
Set 'Filter type to expose' to 'Grouped filters'.
Check "Allow multiple selections"
Set 'Widget Type' to Radios.
You probably want to empty 'Label'.
Remove all but one of the filter sets in the table below.
In that remaining filter set:
Fill in the label ('Citrus fruits' in your example).
Set 'Operator ' to 'Is one of'.
Under Value select the values you want to filter on (Oranges and Lemons in your example).
This gives you 1 checkbox, labeled 'Citrus Fruits'. So the UI is there. Unfortunately, issue [#2224601] prevents that it works, as it results in an invalid query, but a working patch is available.
Assuming that you are using BEF and that you have checked the "Checkboxes/Radio buttons" option for your exposed filter in the BEF options, the way to set check boxes instead of radio buttons is to check "Allow multiple selections" in the configuration dialogue for your exposed filter in Views.
I think no answer here answers the question.
"What I want is to display a single checkbox that when checked applies/enables the filter, and when unchecked ignores/disables the filter. I don't think Better Exposed filters allows me to do that."
You dont need "Better Exposed filters" to do this.
You need to use grouped filters.
Click expose this filter to visitors
Filter type to expose: Grouped filters
Check 'Optional'
Check 'Widget type: Radios'
Check 'Allow multiple selections'
Remove/empty 'Label' if needed
In the bottom you will have few rows where you can set each one as you wish. If you want only one, remove all but one
Click Apply
This answer is very late. But I hope this helps someone.
You would assume that Views would do this out of the box. It doesn't. Use the Better Exposed Filters module -> http://drupal.org/project/better_exposed_filters
It even has nested checkboxes/radio buttons for taxonomy with hierarchy.
Here's some documentation specific to what you're trying to do...
"Checkboxes/Radio buttons: This option is available for any filter that has a limited number of options. Tick the Force single option to use radio buttons, untick it for checkboxes.
Nested Checkboxes/Radio Buttons: While this option shows for any filter that the regular checkboxes option shows for, it's really only of use for taxonomy filters with hierarchy. If you're using a taxomomy filter with Selection type set to Dropdown and Show hierarchy in dropdown ticked, these filters will be rendered as nested, unordered lists. Tick the Force single option to use nested radio buttons"
I have content type called news. I have a view thats lists all the news. But now I would like to filter those by year and type. User could select from select menu / dropdown the publish year (2010, 2011, 2012 so on) and also the type of the news (taxonymy terms).
I was playing around with views exposed but I only got a text input field. Can I somehow get a select menu instead of normal input field? And also how can I list all the publish years when news are published to that select menu?
Should this be done even with views?
====
PAGE
Filter dropdowns: -type- -year-
Press releaseses listed down here according the filters.
Select boxes will only be used in Views exposed filters when there is a finite number of possible values. In other words, if your field you want to filter on has something set in the 'allowed values' section you should have the option of a select box if you choose "FIELD NAME - Allowed Values" as the field to filter on in Views.
If your field has an unlimited amount of possible values, you could always write a custom module to create a block with a form that presents your select boxes and directs the user to the view (using the filter parameters of the view).
I've a problem with Drupal Views. My requirement is to add a custom select box in exposed filters.This select box contains some field names (the names of the fields in the views sort criteria), and when i select a value in this list, I must get the result in sorted order based on the selected value in the select box.
How can I do this?
Thanks in advance for your help
I think the easiest way is to set the view style to table. Then for the table style options you can specify which columns (fields) can be used for sorting and you can define a default sorting field. As a bonus you can set AJAX to yes, so the sorting of the table doesn't trigger the page reload.