0

I have a module with a view and some other functionality. I want to give site managers the ability to change the filter on the view (this isn't an exposed filter) but not give access to change the view. I know how to make a form for the module but what would I use to get the information from the view and return the information. I assume it is one of these: https://api.drupal.org/api/views/views.api.php/group/views_hooks/7.x-3.x

3
  • Is this a reason you can't use an exposed filter? Allowing changes to the filter but not the rest of the view is the specific use case of exposed filters. Aug 15, 2020 at 3:52
  • It is a one page view that is meant to just show all the content of a site but a site admin can decide if it shows all or some content. They don't want anon users seeing all the content (media and such).
    – kmharrell
    Aug 15, 2020 at 13:41
  • 1
    Duplicate of Add FILTER CRITERIA in Views Programmatically Personally, I wouldn't use the accepted answer. Go with Rix's (which programmatically prints the view) or Duncanmoo's answer (which uses hook to alter the filter).
    – No Sssweat
    Aug 21, 2020 at 13:31

0

Browse other questions tagged or ask your own question.