Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
OK, struggling with this one. Posting to try and get some help ;)
Role Weights now has a simple database table containing a {rid, weight} pair. Therefore, I should able to JOIN node to user_roles via uid, then user_roles to my role_weights table via rid.
Based on the Views developer docs and hunting through various contrib modules, here's what I have so far:
Thanks to moshe and eaton on IRC for pointers! With Views and Role Weights enabled, views can now access/display or sort by the node author's role weight.
Slowly but surely, views.module marches towards world domination. ;-) Looks like a great piece of work, paul. I'll have to try it on one of my editor/user oriented sites.
(I also use it on a dev site to display different icons for roles next to usernames - users can be in multiple roles, but the icon will always show the 'highest' role icon)
Comments
Comment #1
pfaocleOK, struggling with this one. Posting to try and get some help ;)
Role Weights now has a simple database table containing a {rid, weight} pair. Therefore, I should able to JOIN node to user_roles via uid, then user_roles to my role_weights table via rid.
Based on the Views developer docs and hunting through various contrib modules, here's what I have so far:
Which, I thought could work, but alas no. Can anyone spot what I'm doing wrong? Thanks!
Comment #2
pfaocleThanks to moshe and eaton on IRC for pointers! With Views and Role Weights enabled, views can now access/display or sort by the node author's role weight.
This is still relatively untested.
Comment #3
eaton commentedSlowly but surely, views.module marches towards world domination. ;-) Looks like a great piece of work, paul. I'll have to try it on one of my editor/user oriented sites.
Comment #4
pfaoclePlease do, it needs proper testing!
(I also use it on a dev site to display different icons for roles next to usernames - users can be in multiple roles, but the icon will always show the 'highest' role icon)
Comment #5
(not verified) commented