| Project: | Front Page |
| Version: | 7.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | timhilliard |
| Status: | closed (fixed) |
Issue Summary
I have a setup where users have several roles such as local student, distance student, and then all the class names (so I can limit access to different class materials using roles as the limiter).
The problem is, I want the local students to have one front page, the distance another. But the way this module works, if the user has more than one role, it takes the first role...and this is NOT based alphabetically...in fact, I can't tell WHAT system it uses, but it does display a series of numbers, one for each role. Is there a way to change those numbers? And if not, could this module be modified to allow me to choose which roles it will deal with, ignoring other roles I choose to have it ignore?
Comments
#1
Hiya brianpeat...
The system for front page by role type is as follows:
Note:When using the front pages by role option, please note that if a user has multiple roles the first role match will determine which front page they see. Here is the order that the roles will be checked (from left to right).
5 student | 4 distance | 3 team | 2 authenticated user | 1 anonymous user |
The default setting for new roles is SAME AS AUTHENTICATED USERS.
So reading from left to right, the module is checking each role type by the order the role was created in reverse. The most recent role is checked first and the number refers to the
$role_idfor each role type.I think it's a good idea to allow users to override that, by entering in their own order.
Probably the simplest way to do it would be to insert a text field where site admins could insert a custom order, using the role IDs seperated by commas, such as:
custom order: 3,5,4,2,1
3 team | 5 student | 4 distance | 2 authenticated user | 1 anonymous user |
I'm busy at the moment so let me know how urgent you need that feature and/or suggest a patch so it can be applied to the module.
Dub
#2
It's not urgent as they haven't actually approved this project (I'm just testing to see if Drupal can do what I need it to do, and it appears that it can).
But yes, the ability to rearrange the order would be nice. You might also change the wording on that sentence. There's an entire paragraph of roles in mine, so when it says "left to right" it's kind of confusing.
your comment of "the module is checking each role type by the order the role was created in reverse" makes more sense than "left to right"
Anyway, while it's not urgent, I'd still love to see this done in the next few weeks if possible.
thanks!
#3
actually, I realized (thankfully) that my special student roles were added LAST, so they WERE being read first. I had just missed that last field where I needed to change node to front_page, so for now there's definately no hurry on new features for this module.
I do notice ONE peculiar thing about it though (maybe it's a feature). If you have anything else promoted to the front page, (like a block) it will push that block right up against the custom front page. I found I had to put
tags in to push it down. No biggie though, I suppose it's better to have to add space than to not be able to remove it in a pinch. Thanks for a cool module!
#4
It would be great to be able to resort the role numbers!
#5
We're using the ldap_integration module against Active Directory, and creating roles on the fly based on the OU's in Active Directory. As the organizational hierarchy changes, it creates additional roles, but not necessarily in the proper order. If we were able to sort the order or, better yet, place a weight on each role, our users would see a customized page for their most unique role. For example, my roles coming from Active Directory are "Employee", "Staff", "Business Services", and "IT Staff". With a weighting in place, I could give the "IT Staff" role the highest weight, on down the line to the "Employee" role having the lowest weight.
#6
We are using the front page module as we set up our next generation library web site. At this point we would like to be able to control access as follows:
We would like staff to be greeted with a generic staff only page with links then to the various web author teams pages.
So we would like all staff to be members of the staff group, and then each staff could also be a member of a specific web author team.
The lack of any control on the role assignment order by the front page module limits the modules usefullness. I see there have been several other requests here for some control of the front page role assignment.
Is there any possibility this could be added to the module in the near future?
Otherwise we will have to try some other less desirable work around or make do. We are mainly librarians and users, not coders, so it is unlikely we could modify the code ourselves.
#7
subscribing
#8
imce does a nice job of sorting roles, perhaps it would be possible to use a chunk of that code? I don't think I'm skilled enough to do it, but I am hoping the time it would take can be reduced if you reuse some of imce's code.
#9
subscribing
#10
im updating the module at the moment. will try and include this functionality.
#11
subscribing
#12
It's not exactly elegant, but I've attached a quick and dirty patch to provide admins with the ability to order the roles.
You have to enter a space separate listed of role ids.
The patch is written for the Drupal 5 version of front_page.
jamie
#13
That's a good idea for Drupal 5.x. Role weights is available for drupal 6.x which might be a simpler solution.
http://drupal.org/project/roleweight
#14
hi there,
i modified front_page so that it respects the orders set in the module roleweight. if roleweight is not installed, the module behaves exactly as it does currently. thanks to Dublin Drupaller for actually making the patch for me.
it is attached:
cheers,
andy
#15
great work Andy. I'll run some tests asap. Can others test it too and come back with feedback before we put it into a release?
cheers
dub
#16
The module http://drupal.org/project/roleweight seems to be deprecated in favor to http://drupal.org/project/role_weights.
Could the #14 provided patch be ported to the latter as the former will never get stable status (#421624: Role Weight Vs. Role Weights) ?
#17
Attached is a patch, based on #14 but using the Role_Weights module instead.
Seems to work for me. Can anyone else test it?
#18
Well, it looks working but I think the part doing the SQL query should be delegated to a function provided by the role_weight module in order to avoid tight coupling with role_weight data model.
Maybe a patch has to be submitted to role_weight maintainer.
#19
I am using Front Page (front-6.x-1.2.tar.gz).
I have 8 roles, and want to reorder the roles to my preferences.
Reading the instructions herein, I installed the Roleweight module (http://drupal.org/project/roleweight, roleweight-6.x-1.x-dev.tar.gz).
I did try the patch file within this thread, but it will not apply. Is the patch intended for 6.x?
This is a practical expansion of the functionality of Front Page module, as it allows more granularity in the sorting of users by user definable roles with user definable importance.
Currently, it looks like I can edit the database and change the order there, but would be nice to have a cleaner way to do this, as described herein.
I just tested patch on item #14 above, and it works. I did not see the same functionality with the other listed patch using Role Weight instead.
Will this be merged into a new build?
#20
Same here as #19 - patch in #17 doesn't apply to 6.x-1.2.
#21
@ernest #19 yep this will be rolled into a new build, eventually. I'm hoping to get to it in may.
#22
Also, I would recommend not changing the role numbers in the database per #19. It could have seriously negative consequences in regards to permissions. For example, if non-authenticated users is role #1 and administrators role#2, and you switch these in the database, your non-authenticated users will now be treated as administrators and vice versa. You'd have to go back and re-set all of the permissions.
#23
For those having trouble with the patch on #17 for 6.x-1.2, I have attached the modified front_page.module file. I don't know how to patch, so you will have to replace your current version of front_page.module with this one - albeit with the ".txt" removed from the end.
#24
I replaced my front_page.module with your text file, loaded, configured and ordered roles with the Role_Weights module but the changes in weights aren't reflected in the advanced front page settings. What am I missing?
thanks
#25
Subscribing.
Is this functionality available in the dev version?
#26
I would really love this functionality. Has anyone got this to work, and if so how, please?
#27
Subscribing!
#28
Hi guys I will be implementing this feature in the next release of front_page. I will be releasing the 7.x version first and then backport it to 6.x. As the two role weight modules are not implemented in d7 I will build this functionality directly into the module. If anyone has any issue with this please let me know. I should hopefully have this in within a week or two.
Cheers,
Tim
#29
Hi guys, drag and drop as well as many new features are available in the 7.x-2.x branch. This is currently in dev and needs to be tested but I believe there is not too much more that needs doing before we can get a release out so if some of you could test this and let me know whats your thoughts are and if you find any bugs I would be greatly appreciative.
Cheers,
Tim
#30
Also forgot to mention that as soon as we can get a release out for this I will work on the backport for 6.x-2.x version.
#31
I just hit this for my Drupal 6.x site. Eagerly awaiting a fix!
#32
just changing this to feature request so I can clean up the issue queue.
#33
This is now available in the 6.x-2.x branch. Closing