Questions related to sorting of results, usually retrieved from a database.

learn more… | top users | synonyms

-1
votes
0answers
16 views

How to sort comments on 2 different fields? [duplicate]

The following is the sort_comments. module file: <?php /* drupal@ganovelli.it - blackice78 */ define('SORT_COMMENTS_OLDER_FIRST', 1); // default ...
0
votes
0answers
17 views

Sort comments base on a field

This is the sort_comment.module file. <?php /* drupal@ganovelli.it - blackice78 */ define('SORT_COMMENTS_OLDER_FIRST', 1); // default define('SORT_COMMENTS_NEWER_FIRST', 2); /* ...
0
votes
0answers
6 views

filter terms starting with a certain character and put them in the beginning

I got a vocabulary called "Locales". there's about 20 states in it and 5000 cities. now, there's also something that my client wants to call "generic states" which, are names of countries, that start ...
1
vote
2answers
46 views

Taxonomy terms view sorting results numerically

I have a taxonomy that's comprised entirely of numeric term names, 1 through 1200 (with a few numbers missing in between). I created a new "Taxonomy terms" view to show all terms in this vocabulary. ...
0
votes
1answer
18 views

Sort Comments by a new filed in comment table

I am writing a module which allows users to put comment on each paragraph. I have added a new field to the comment table, called "paragraph_id", and in the comment form I have added a filed that asks ...
0
votes
0answers
14 views

sort based on creation date of referencing node [closed]

I have 2 content types - Questions and Answers. Answers are referencing to Questions using entity reference module. Task: I would like to create a view - a list of Questions sorted by creation date ...
0
votes
0answers
14 views

Views hook with a custom sort order - pager is not updated

I have used hook_pre_render and hook_post_execute (tried both) to reorder view results with a custom value. This value is calculated after the query is run so it's not available prior to the query ...
0
votes
0answers
48 views

Sorting on multiple fields using Search api Sort

I want sorting on multiple fields like my custom field in DESC order and Price in ASC order based on some condition. Basically a two level conditional sorting. How can I do that ?
0
votes
1answer
103 views

View sorting programmatically

I have a view with grouping (by one field) and sorting by nodequeue weight. I want to sort the groups as well so I've used hook_views_pre_render and sorted the results array programmatically, but as ...
0
votes
1answer
28 views

Views Sort Criteria: Sort by Taxonomy terms

I have a view that lists team members of a country that are referenced by an Entity reference field. Now these team members can have different functions and job titles. I assign them through a ...
0
votes
1answer
47 views

Drupal Views Sorting problem

I have a question on views sorting. I have two content type(TypeA TypeB) which has the same field. And i use views to list all the content with the sort i want. Right now my problem is i want to ...
0
votes
0answers
20 views

Taxonomy Sort as as a dropdown

One of my client requirement states they need to sort some field based on taxonomy id. I am very much fine with sorting it based on Id or name in asc or desc order. But client states that they need to ...
0
votes
0answers
27 views

Views attachment - Inherit sort option from Table

I am using a views with format "Table". The fields on the table are sortable. Under this base view I have a views attachment. The attachment has the same content but with different Format. I am also ...
0
votes
1answer
35 views

How do I sub-sort a view?

We have a view containing two fields that we would like to sort - specifically issue # and Title. We would like to sort the view first by the Issue # field and then secondly by Title, so that nodes ...
0
votes
1answer
57 views

Altering the views Sorting Criteria, to display first ISSET fields

Ia am working on a view that displays search results for nodes of a certain content type. In this Content Type there is a field "photo". Some of the nodes have a photo, some of them not. Is it ...
1
vote
2answers
754 views

How to sort content in Views by menu weight

I have a D7 Views view which delivers a number of nodes. I would like them to be sorted based on the weight that their relevant menu items have. I would like to avoid the fine module DraggableViews ...
0
votes
2answers
99 views

How to get view by tag sorting the same as main view sort criteria

I am new to Drupal 7. I have a view set up at /people with the sort criteria set to a field called surname. This is working fine, listing people out alphabetically by surname. I have tags associated ...
1
vote
2answers
952 views

I have no fields available for sorting with Search API sorts module

This question is similar to another question I had, but now in a different context. My previous question was: Search text box for Search API + Database + Search Views + Facets API + Facets Bonus ...
3
votes
1answer
166 views

Views sorting by number of values in field

I have a content type with an text field with unlimited number of values. I have a view for that content type and I want to sort it by number of values in that field. How can I do that in Views?
0
votes
1answer
35 views

Extra sorting criterium in case of ex aequo with Views

My articles have a 'Ranking' field, which contains an integer. I have a view that sorts articles depending on this value: the article with the highest score is a the top. Now, in case of an ex aequo, ...
1
vote
1answer
169 views

Views - Select list field type as sorting order criteria

I have a view which uses a custom field called article type as it's sorting criteria to sort articles. This article type field, has the following options: 0Editorials|Editorial 2Feature|Feature ...
0
votes
1answer
278 views

Drupal 7 views complex sort

I have a drupal view which displays 10 items. I have 3 items which need to remain at the top of the list, which i have done by making them sticky. These need to be in a particular order. The the rest ...
0
votes
1answer
65 views

Advanced sorting question about drupal views

I have a content type with latitude and longitude coordinate fields. i have a view that is displayed on each page with this content type, and a google map plotting the location. Is there any way to ...
0
votes
1answer
102 views

Only sort views after selected

I am looking to sort nodes in a view, but only after the user has selected the sorting value. So the nodes are currently listed in posting order, but I would like to provide the user to sort by ...
0
votes
0answers
16 views

Do not sort until selected

For a view I have the sorting in the following order: Sticky Posting Date Artist Title I am looking to add in sorting by Price, but I do not want the initial display to sort by price (ie most ...
0
votes
0answers
44 views

Sort view fields alphabetically with aggregation on

I currently have a views page which displays a list of all authors with the number of publications they published. This was accomplished using aggregation. I would also like to sort the author names ...
1
vote
1answer
427 views

Is there a way to create a sort option for search results that works together with facets?

I'm using Drupal Commerce along with Search API and Facet API to create a search for my product dispays. Is there a way to create a facet that sorts products by price? I've tried using the exposed ...
0
votes
1answer
180 views

Order nodes based on entity reference filter

In my Drupal 7 website I have an A content type with an entity reference 'parent' field which I use to link to nodes of a B content type. I have to implement a way to sort A nodes basing on their B ...
0
votes
1answer
104 views

Ordering Users for use in view

I have a view that displays data for each user. Now I would like to be able to order the users. One solution would be to add a new field called something like field_weight to the user content type ...
2
votes
1answer
46 views

How to put a date token at the start of Backup and Migrate file name pattems?

Because Backup and Migrate sorts files by age, when you untar or copy some files to a destination, they will be more or less the same date and it may be hard to tell which ones are the latest etc. ...
0
votes
2answers
142 views

Customize order of a list in Drupal 6

I have a list of links that are all displayed as one list. They are currently sorted by 'Title' asc. I would like to customize the order of this list. How can I do that in Drupal 6. Example: A1 ...
1
vote
2answers
261 views

Can't we sort a “Node module element”?

I'm creating a new content type named "Portfolio". Image 1: I put a name to the "Title field label": Project Name Image 2: That thing works as a 'Node module element' in Fields Image 3: I can't ...
1
vote
1answer
117 views

Exposing sort breaks order

In my view I am exposing two sort options in the following order: Date > Newest First Title > A-Z When both sort options are exposed it will correctly display the nodes sorted by date but will ...
2
votes
1answer
920 views

Views: custom field for sort criteria

My View has a " Global: Custom text"- Field that contains Integers (1,3, ..). The field is overwritten by a php-Template. I want to add this field to "Sort criteria", so the view can be sorted - but ...
1
vote
2answers
775 views

Combine views sort criteria in exposed form

Drupal 7, views 3.6. I have a view with 2 sort criteria: date and category. The sort is exposed in a form block. Currently the user only has the choice to select 1 sort criteria, ie: sort by date ...
0
votes
1answer
74 views

Job board: Faceted Search with “OR” operator, but sort results by most matching facet criterias/term count

I'm quite stuck with searching for a solution for my problem and I hope that you can maybe help me. In general I want to build a small job platform. It includes an "Explore"-Section, which is just ...
1
vote
0answers
62 views

Apply Radioactivity in Hashtags like twitter

How to apply radioactivity sorting using Radioactivity module(like trending in twitter) to taxonomy terms as Hashtags in block. Now i apply sorting criteria hashtags:delta. Whether any other module ...
1
vote
0answers
181 views

Sorting prices from 3 product line item types using views

My goal is to display a message like "Prices start from 13.34$" for every taxonomy term that I created. I have 3 product types with 3 product line item types. What I did until now and I'm stuck is to ...
2
votes
1answer
885 views

Views: how to ASC sort the grouping field #1 and sort DESC its content?

I have views grouped by year (grouping field #1) that I want to sort from the most recent to the oldest. I have content referenced to the year. This returns me a HTML list such as: 2013 - alpha - ...
1
vote
1answer
274 views

which hook to change the node order in a view?

I have a custom view but now I want to put the nodes created by a specific user role on top. I want to do this using code so I can easily implement this throughout multiple web pages. I'm thinking ...
0
votes
2answers
168 views

How to sort a view so that, say, all the nodes with stock=0 come last, and not sort by stock?

I want to sort an output of a view so that the elements with a filed value of "0" be at the end of the list, but all the others are to be treated equally. In fact, it's an Drupal Commerce site, and I ...
3
votes
1answer
194 views

Flags - Recreate the 'poke' function

I need to create a flags view that displays a list of users that have "poked" the current user with D7, Views 3 and Flag 3. I've read through this question and drupal.org/node/296971, neither ...
0
votes
1answer
123 views

How to make a table sortable by CCK field

An odd question: I have a custom column added to the default admin/content page that shows the value of a CCK field "field_foo". I'm trying to sort the table by this field. (I can't use Views for this ...
0
votes
1answer
189 views

How to generate a List of Dates with Start/End sorted by Month in Drupal7?

I have installed Drupal7 and created a content type (why not call it 'event' for now) to which I added a date field (lets name it 'event-date'). Some event-dates have start- and end-dates. Now I want ...
0
votes
1answer
143 views

How to apply image style to image field in view based on the sort position of that image field?

my homepage is done with panels. Home panel contains a view that displays specifically 9 nodes that contain image field. Sort criteria is Random. These 9 nodes are in three rows each containing three. ...
1
vote
1answer
30 views

Adding titles to sorted nodes in a View

So I'm struggling again with my sorted links: there are many many links (node type) which also contain the field "link_category". I collect them all in a view and sort them by "link_category". It ...
0
votes
0answers
149 views

Sort tableselect on taxonomy name (not tid)

So I've got a nice list of products in a tableselect element, like this: $form['nodes'] = array( '#type' => 'tableselect', '#header' => $header, '#options' => $options, '#empty' ...
2
votes
0answers
209 views

Field values sometimes do not show up in grid view or node view for non admin users (Drupal 7)

I have a view that is sorted by the number of times a user visits a node and clicks the play button (the play button is a menu item of the node). Every time the play button is pressed the value of an ...
0
votes
1answer
57 views

Add weight parameter in a custom module

I created a content type and it has many nodes. And I wrote a custom module to show nodes on the front page. My nodes order: $themeurl = '/drupal/'.path_to_theme().'/images'; $sql = "SELECT * ...
1
vote
1answer
637 views

New to Drupal and views, how do I change the order of my fields?

How do I change the order of these fields? See the image. I want to be able to change the output order of these fields.