Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I try to add a link appear in /admin for a specific role. This specific role has a few permissions (adding specific content for example) and I would like to hide certain links appear in /admin and to add other links in this same page.
I tried to use the hook MYMODULE_page_attachments_alter but I did not find the way to add links into this.
PHP 8.1 introduced a new data model, Enumerations. Enumerations allow for the creation of custom data models that can only contain a fixed set of allowed values. These enumerations can be very useful when working with Drupal list fields, which are a field type that allows for selection from a predefined set of values. As both enumerations and list field contain a predefined set of values, using Enumerations to back Drupal list field makes for more stable code that is easier to understand, and less likely to fail.
I'm developing a Drupal 10 website with the DXPR Builder default theme and have two views that combine Flex Slider with the content events module to display events. My goal is to:
1. Display the first slider for both anonymous users and logged-in users.
2. Display the second slider only for logged-in users who have specific roles (e.g., admin, manager, content creator).
I've attempted to achieve this using Contextual Filters, but I haven't been able to get it to work as expected.
This thread may wander a lot, but the original reason for creating this thread today is that I have a .js file with mostly jQuery instructions within it. This script is supposed to help me re-order a select list on a [Better-Exposed-Filters] form; and, believe it or not, it works! Except on ONE of my many Drupal 10.3 websites.