Skip to main content
17 events
when toggle format what by license comment
Feb 3, 2015 at 7:43 comment added Brady Good to hear you found a solution!
Feb 2, 2015 at 20:02 history bounty ended Smern
Feb 2, 2015 at 20:01 vote accept Smern
Feb 2, 2015 at 20:01 comment added Smern It seems custom themes was the right answer for me, I followed this tutorial which provided more details on the process. I believe this is what you meant by your second solution.
Feb 2, 2015 at 0:49 comment added Smern I'm not sure what you mean with the URL's as there will be multiple groups of multiple items where each group is a view and each downloadable item is a view within a group. On a single URL there might be a dozen or more downloadable items, some of which the user may see the "download" button (which is based on a file field) and others where they will see "you don't have access..."
Feb 1, 2015 at 23:58 comment added Brady There isn't. You will have to have two views with two different URLs. If you desire to do this from a single URL and display different content based on the user role you will need to either implement this in the theming layer overriding the core content view (not Views module - core Drupal theming of content types), use panels, or find another contrib module to give you this capability.
Feb 1, 2015 at 20:03 comment added Smern I don't remember there being a way to filter certain fields of a view out without using the Custom Formatters Module, but what I didn't like about that is that I then had to write PHP in the browser in a field to make it work.
Feb 1, 2015 at 17:39 comment added Brady BTW, Panels was written by the guy who wrote Views. If that gives you some idea on how well they work together.
Feb 1, 2015 at 17:38 comment added Brady So that is another way of doing it. You can restrict the Views you have created. The Views have a permission function. You will need to use contextual filters to change which view is displayed to switch between the "has rights" and the "not has rights". This is actually easier with Panels using the Variants and Selection Rules provided by Panels. Then you have one URL with no worry about contextual filters. Panels handles displaying the content for you based on the role the person has.
Feb 1, 2015 at 17:03 comment added Smern I am pretty new to Drupal so there may be different ways of doing things. How I've been doing it is, I build a ContentType and then I build a View for that ContentType and use "Fields" in the View. So when I say ContentType/View I mean that I have both of them for the downloadable_item and the downloadable_group... and then using the Views Field View module I insert downloadable_items in the downloadable_groups. I was hoping that the downloadable_item view would be able to handle on it's own how it displays the downloadable button (based on the User role and the allowed_roles field).
Feb 1, 2015 at 16:42 comment added Brady Regarding your second comment. I am explaining how to do this with Panels. Panels has a "Selection Rules" associated with each variant you create. This isn't something you have to create, it comes with the module.
Feb 1, 2015 at 16:39 comment added Brady I am just confused when you say ContentType/View. A View is a very specific thing in Drupal, it involves the Views module. So you build Views of your ContentTypes? Correct?
Feb 1, 2015 at 16:04 comment added Smern This is an internal company thing which I cannot share. Did you need any additional information from me?
Feb 1, 2015 at 14:08 comment added Brady Do you have a live dev site?
Jan 31, 2015 at 15:42 comment added Smern The reason I posted the above is that I am concerned about whether or the way I have things set up will conflict with the solutions. Also, in the first solution you mention "a selection rule of User:role with the role you want to use to allow access to the protected content", I am not at my workstation so I cannot look now, but I am not sure where or how I would create a rule that has the ability to look into the User's role and all of the fields contained in the UserRole field and compare the two. The UserRole field will have multiple roles that will be allowed.
Jan 31, 2015 at 15:32 comment added Smern Thanks for the response. I've only started using Drupal about 2 weeks ago. In my case, I have a ContentType/View called downloadable_item with the download button. I have a ContentType/View on top of that called downloadable_group which uses the ViewsFieldView module and contextual filter to house multiple downloadable_item. The downloadable_group view pane is then placed on a page and uses contextual filters as well and may contain multiple downloadable_groups. I don't know if this changes anything or not and I will look into how these solutions will work in my project on Monday.
Jan 31, 2015 at 10:30 history answered Brady CC BY-SA 3.0