This project is not covered by Drupal’s security advisory policy.

Screenshot of the Lenses module

Lenses allow you to view, edit, or create content while only being shown a particular subset of its fields.

When you look at or edit a piece of content through a lens, you only see the parts of it you are interested in, allowing you to focus on a particular task at hand.

For example, a person who is responsible for uploading photos to a website could have a lens that only shows the site's image fields. Regardless of what type of content they edit and how many other fields it has, they could go to a URL like node/123/view/photos or node/123/edit/photos, which will apply the lens and strip out the other fields, thereby allowing them to quickly view or edit the fields they are responsible for.

Lenses have a variety of options. In addition to choosing the individual fields that are associated with the lens (and whether the lens will show or hide the fields you have chosen), you can configure whether or not the lens will apply when viewing, editing, and creating content, whether it will be shown as a visible menu tab when doing so, and several other options.

Related projects

There are other concepts in Drupal that can achieve some of the functionality of this module. These include view modes (originally introduced in Drupal 6 core), form modes (introduced in Drupal 8 core), and contributed modules such as Display Suite and View Mode Page.

The biggest thing that makes this module different is that it treats the collection of fields in a lens as a standalone concept of its own, that can be applied anywhere on the site (both viewing and editing, and across all types of content), rather than separately in a few different places. It is therefore intended to be convenient for site builders and developers, and also to allow non-site-builders to create and edit their own lenses from a single user interface, without understanding the details of Drupal's data model.

Current status

Currently only an older and partially-working version of the code (that is specific to nodes) is available for Drupal 5. The module needs to be updated to Drupal 7, which will allow the code to be simplified while also making it more powerful.


Work on this module was originally supported by an NSF Astronomy and Astrophysics Postdoctoral Fellowship under award AST-0602259 to David Rothstein. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation.

Project information