Skip to content

Drupal: Views Contents By Role

Randy Fay erklärt wie man unterschiedlichen Rollen unterschiedliche Inhalte in einer View präsentieren kann – und die Umsetzung ist sehr simple:

The strategy: Create three different displays in the view, each of which is limited to a particular role, and each of which has its own filter. The administrator display has a filter that chooses pages, auth user one that chooses stories, etc.

The devil’s details: The displays must be ordered by most restrictive to anonymous. The displays are apparently attempted in the order they’re shown on the views edit screen. So we need the most restrictive (administrator) first. On that one only administrators will succeed. The next display has the authenticated users, etc.

Possibly related posts (automatically generated)