Active
Project:
Role Weights
Version:
7.x-1.x-dev
Component:
External module integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2009 at 19:35 UTC
Updated:
4 Mar 2014 at 21:21 UTC
Jump to comment: Most recent
Comments
Comment #1
liliplanet commentedI'm prepared to pay for the Role Weights update to 6.x to sort in views (via www.moneybookers.com) as follows:
The way it worked in 5.x was you were able to edit roles at admin/user/roles and set their weight.
Then in views you were able to sort the view by role weight in 'sort criteria'.
Basically I could have my highest roles show first in the view, then second, etc. It is for a member directory.
Would so much appreciate this capability and so important to my views.
Look forward to any suggestions, and again, thank you.
Lilian
Comment #2
liliplanet commented* sorry for the bump * have to sort in views by role please :)
Comment #3
pfaocleComment #4
pfaocleLimited Views functionality equivalent to that in 5.x-1.5 added. Room for much improvement. #64071: Views support: when sorting by role weights a node appears three times. also needs addressing in both 5.x/6.x branches.
Comment #5
pfaocleThe biggest problem currently is that in joining the base
nodeoruserstable torole_weightsviausers_roles, we create duplicates when users have more than one role (other than anonymous/authenticated).After rummaging around Views docs and code, the same problem occurs in Views taxonomy support. Create a simple, new node view showing nodes with more than one term, sorted by Term ID. Duplicates appear for each node with more than one term.
So how to tackle this? I'm going to shout out on the Views dev group at some point soon, just noting some thoughts down now.
Currently looking at maintaining a
{role_weights_max}table, which would store:and could be updated when a user's roles are modified, or role weights themselves are changed. With this table maintained, the Views join is much simpler and we can provide simple fields for Lightest/Heaviest Role Weight, for sorting at least.
Comment #6
mcaden commentedEDIT: Nevermind, brain fart on my part looking at the query wrong.
Comment #7
stuhannaford commentedCouldn't get Views User Role support working like a lot of people using this module which is a shame because the 5.x version seemed perfect. I have found a work around for anyone wishing to use this functionality, http://drupal.org/project/user_badges
With this you can add badges to any role, and then order the badges by weight, allowing you to sort Views by badge weight. Personally, the use of badges being displayed wasn't important but the ability to display Views with Premium Role users' nodes first was great. Like I said, bit of a work around but works exactly as I'd hoped. I'm using this function on a Wedding directory based website (www.whiteweddingpages.co.uk) where users can pay for a better advertising listing depending on the role they purchase via Ubercart
Comment #8
pfaocleComment #9
pfaocleComment #10
pfaocleCheck out sandbox code mentioned in https://drupal.org/comment/7170922#comment-7170922
https://drupal.org/sandbox/rv0/1937404