logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

How to properly use Global: PHP in a view for content filtering?

22/02/2025, by Anonymous (not verified)
Forums

Hello everyone!
I kindly ask experienced forum members to help with a task.
I want to create a filter in the view using the PHP filter - the filter name is Global: PHP.

This view is a custom page I created. It displays form fields.
The view outputs several form fields. One of them is the username. This user is not the current user.
I need this view to be visible only to users from that field.
How should I correctly write the filter code? In Global: PHP, among the AVAILABLE VARIABLES, this field is displayed as $row->field_name
If there are other filtering options without using Global: PHP, I would be happy to hear them. In CONTEXTUAL FILTERS, there is no option to filter by this criterion.
I am using Drupal 7.
Thank you in advance to everyone who takes the time to help!