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
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 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.
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).
I need to have a Views that is different for different roles. But, I don't know what will happen when a customer meets the requirements for all the displays for that View. Which display will she see?
If you're referring to the display within the views: each view display has a position and the displays are loaded according to that position in an ascending sort. So if you create a page display (which may get a position of 2 since the Default display typically has a position of 1) and then create another page display after that, the next page display may get a position of 3. The customer will be exposed to the position it reaches first (2, provided that they have met the criteria).
If you're referring to the views themselves: views are loaded in order of their view id (vid). The customer will be exposed to the first one loaded.