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

learn more… | top users | synonyms

0
votes
0answers
7 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
21 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
44 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
23 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
29 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
17 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
19 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
30 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
38 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 ...
0
votes
2answers
365 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
81 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 ...
0
votes
2answers
475 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
115 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
27 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, ...
0
votes
1answer
134 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
223 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
52 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
85 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
39 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 ...
0
votes
1answer
289 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
137 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
82 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
40 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
133 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
213 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
108 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
728 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
701 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
67 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
54 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
163 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
703 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
222 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
163 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
177 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
116 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
167 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
138 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
29 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
132 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
200 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
51 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
493 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.
0
votes
2answers
45 views

Show new result each time I visit the page

I want to display a result in a view, and each time I visit the page, the result will be the next node from the choosen contenttype. Is this something I can manage in views or is there any other way? ...
0
votes
1answer
21 views

View Paid Sorting

I wanted to do something like following scenario. So for example I have a view of content type 'mycontent'. Bob wants to be on the top and he is paying me money for it. Is there any way I can show ...
1
vote
1answer
152 views

Field sort random via PHP

I have a image field and use on cycle. field.tpl.php: <?php ?> <div class="<?php print $classes; ?>"<?php print $attributes; ?>> <?php if (!$label_hidden): ?> ...
0
votes
2answers
332 views

Random image with Cycle

I'm using Drupal Cycle module and list field_images items. I check 'random' button, but it is not working. I want get random image every refresh page. How can do it? field_sort_items or anyway ...
1
vote
4answers
222 views

Sort nodes by latest comments on it

I am using D7. I want to sort the nodes by the comment post date on it. Like Node a created on Jan 03 Node b Created on Jan 05 Normally i can sort it either asc or desc. What i want is a node ...
1
vote
1answer
233 views

How to render random image on every refresh page

I have got a content type and an image field. How can I render the field with a random image at every page refresh.