I've created a views of node and I've selected the "fields" option in order to select which fields to display and in which order.
Is there a way to group such fields ? It would be very useful to have parent divs in my html code.
thanks
There's a simpler way to do it: http://www.arsnova.cc/web-development-articles/2012-07-27/grouping-fields-together-drupal-views
Let's say you want to group fields 1-3 together within a div.
First, exclude fields 1 and 2 from display. (By "exclude", I do not mean to delete them from the views display; rather, click on the "exclude from display" button within each field's options.) The fields you exclude from display must come before the other field for this to work. If they don't, rearrange them so they do.
Go to field 3, and rewrite the results, inserting the token for each of fields 1-3.
That's all you need to do. Fields 1, 2, and 3 will now appear within field 3's div. If you want, you can also add additional markup within the "rewrite results" area.
Recently found the best way for my needs and apparently for the needs of many people:
Use views_fieldsets module https://drupal.org/project/views_fieldsets, it allows yo to create a grouping div to put fields inside.
Grouping is built into Drupal 8 Views. So no need for any extra modules. Here's how:
Edit your view (be sure it has fields)
Click Format's Settings
A box will pop up with all your selected fields
Look right underneath all the field names, there should be "Grouping field Nr.1"
Select the field you'd like to group by
Click Apply
If you want to subgroup with a second field, just go back to 2 then you'll see "Grouping field Nr.2"
That's it.
Yes, click on the gear next to the Style option (under Basic Settings) and set the Grouping field. Keep in mind, the grouping field needs to be added to the view, but you can check the Exclude from display option to hide it, if needed.
I'm pretty sure that would give you a parent div. If not, you could add the parent div, by overriding the default templates (look to the Theme: Information section, under Basic Settings, for more information).
Related
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 2 separate views for the image gallery having categorize using term.
One for admin(draggable) and second for anonymous user. Admin can change
order(weight) of the gallery.
I am using this weight in second views but this is not working properly
Even i have added SORT CRITERIA on **Draggableviews: Weight (asc)** in
both views.
Is there any way to add as a field weight so that i can debug this issue or any other solution
Only solution that worked for me was the following:
go to your content type/vocabulary
add a weight field (label: weight | machine name: weight | field type: integer
edit your sorting view and add sort criteria for your newly added weight field
edit your draggable views field and change "Handler" from Native to FieldAPI
under Field select your weight field
go to your content view and add the new weight field as you sort criteria
This is the only thing that worked for me. If it doesn't work immediately, just reorder a few items on your draggable view so that the ordering values are reset.
Hope this works for you too.
The draggableviews module doesn't use the weight field for sorting. If you have followed the instructions for using the draggableviews module you should have two views, 1 for sorting with the draggable items and 1 for displaying the sorted view. It is important that on both your views you should have the 'DraggableViews: Order' as the FIRST sort criteria.
As a final extra step, you'll go back to your regular page display for the view and add "DraggableViews: Order" at the Sort criteria section and place it as the first Sort criteria. For sorting order, choose "Ascending".
https://drupal.org/node/283498
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'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.
I have a special content-type that I have created, and one of the fields is a radio button list. The last element is named 'Other' and I would like to have a textbox appear and allow the user to enter in a non-defined value.
Is this sort of capability provided by any sort of module, or is this something that needs to be coded by hand? (If so, would you mind pointing me in the correct direction?)
The CCK Select Other module appears to get you most of the way there. I imagine it could be modified to work with radios fairly easily.