You are here

Views field handler plugins in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\views_field_handlers

Handler plugins for Views fields.

Field handlers handle both querying and display of fields in views.

Field handler plugins extend \Drupal\views\Plugin\views\field\FieldPluginBase. They must be annotated with \Drupal\views\Annotation\ViewsField annotation, and they must be in namespace directory Plugin\views\field.

The following items can go into a hook_views_data() implementation in a field section to affect how the field handler will behave:

  • additional fields: An array of fields that should be added to the query. The array is in one of these forms:

  // Simple form, for fields within the same table.
  array('identifier' => fieldname)
  // Form for fields in a different table.
  array('identifier' => array('table' => tablename, 'field' => fieldname))
  

As many fields as are necessary may be in this array.

  • click sortable: If TRUE (default), this field may be click sorted.

See also

Plugin API

Parent topics

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 18

Classes

Namesort descending Location Description
Boolean core/modules/views/src/Plugin/views/field/Boolean.php A handler to provide proper displays for booleans.
Broken core/modules/views/src/Plugin/views/field/Broken.php A special handler to take the place of missing or broken handlers.
Combine core/modules/views/src/Plugin/views/filter/Combine.php Filter handler which allows to search on multiple fields.
ContactLink core/modules/contact/src/Plugin/views/field/ContactLink.php Defines a field that links to the user contact page, if access is permitted.
ContextualLinks core/modules/contextual/src/Plugin/views/field/ContextualLinks.php Provides a handler that adds contextual links.
Counter core/modules/views/src/Plugin/views/field/Counter.php Field handler to show a counter of the current row.
Custom core/modules/views/src/Plugin/views/field/Custom.php A handler to provide a field that is completely custom by the administrator.
Date core/modules/views/src/Plugin/views/field/Date.php A handler to provide proper displays for dates.
DblogMessage core/modules/dblog/src/Plugin/views/field/DblogMessage.php Provides a field handler that renders a log event with replaced variables.
DblogOperations core/modules/dblog/src/Plugin/views/field/DblogOperations.php Provides a field handler that renders operation link markup.
Depth core/modules/comment/src/Plugin/views/field/Depth.php Field handler to display the depth of a comment.
Dropbutton core/modules/views/src/Plugin/views/field/Dropbutton.php Provides a handler that renders links as dropbutton.
EntityField core/modules/views/src/Plugin/views/field/EntityField.php A field that displays entity field data.
EntityLink core/modules/views/src/Plugin/views/field/EntityLink.php Field handler to present a link to an entity.
EntityLink core/modules/comment/src/Plugin/views/field/EntityLink.php Handler for showing comment module's entity links.
EntityLinkDelete core/modules/views/src/Plugin/views/field/EntityLinkDelete.php Field handler to present a link to delete an entity.
EntityLinkEdit core/modules/views/src/Plugin/views/field/EntityLinkEdit.php Field handler to present a link to edit an entity.
EntityOperations core/modules/views/src/Plugin/views/field/EntityOperations.php Renders all operations links for an entity.
FieldFormButtonTest core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldFormButtonTest.php A handler to provide a field that is completely custom by the administrator.
FieldPluginBase core/modules/views/src/Plugin/views/field/FieldPluginBase.php Base class for views fields.
FieldPluginBase core/modules/views/src/Plugin/views/field/FieldPluginBase.php Base class for views fields.
File core/modules/file/src/Plugin/views/field/File.php Field handler to provide simple renderer that allows linking to a file.
FileSize core/modules/views/src/Plugin/views/field/FileSize.php Render a numeric value as a size.
HistoryUserTimestamp core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php Field handler to display the marker for new content.
LanguageField core/modules/views/src/Plugin/views/field/LanguageField.php Defines a field handler to translate a language into its readable form.
LastTimestamp core/modules/comment/src/Plugin/views/field/LastTimestamp.php Field handler to display the timestamp of a comment with the count of comments.
LinkApprove core/modules/comment/src/Plugin/views/field/LinkApprove.php Provides a comment approve link.
LinkBase core/modules/views/src/Plugin/views/field/LinkBase.php Field handler to present a link to an entity.
LinkReply core/modules/comment/src/Plugin/views/field/LinkReply.php Field handler to present a link to reply to a comment.
Links core/modules/views/src/Plugin/views/field/Links.php An abstract handler which provides a collection of links.
MachineName core/modules/views/src/Plugin/views/field/MachineName.php Field handler which allows to show machine name content as human name.
Markup core/modules/views/src/Plugin/views/field/Markup.php A handler to run a field through check_markup, using a companion format field.
ModerationStateField core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php A field handler for the computed moderation_state field.
Node core/modules/node/src/Plugin/views/field/Node.php Field handler to provide simple renderer that allows linking to a node. Definition terms:
NodeCounterTimestamp core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php Field handler to display the most recent time the node has been viewed.
NodeNewComments core/modules/comment/src/Plugin/views/field/NodeNewComments.php Field handler to display the number of new comments.
NumericField core/modules/views/src/Plugin/views/field/NumericField.php Render a field as a numeric value.
Permissions core/modules/user/src/Plugin/views/field/Permissions.php Field handler to provide a list of permissions.
PrerenderList core/modules/views/src/Plugin/views/field/PrerenderList.php Field handler to provide a list of items.
RenderedEntity core/modules/views/src/Plugin/views/field/RenderedEntity.php Provides a field handler which renders an entity in a certain view mode.
RevisionLink core/modules/node/src/Plugin/views/field/RevisionLink.php Field handler to present a link to a node revision.
RevisionLinkDelete core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php Field handler to present link to delete a node revision.
RevisionLinkRevert core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php Field handler to present a link to revert a node to a revision.
Roles core/modules/user/src/Plugin/views/field/Roles.php Field handler to provide a list of roles.
Score core/modules/search/src/Plugin/views/field/Score.php Field handler for search score.
Serialized core/modules/views/src/Plugin/views/field/Serialized.php Field handler to show data of serialized fields.
Standard core/modules/views/src/Plugin/views/field/Standard.php Default implementation of the base field plugin.
StatisticsLastCommentName core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php Field handler to present the name of the last comment poster.
StatisticsLastUpdated core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php Field handler to display the newer of last comment / node updated.
StatisticsNumeric core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php Field handler to display numeric values from the statistics module.
TaxonomyIndexTid core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php Field handler to display all taxonomy terms of a node.
TermName core/modules/taxonomy/src/Plugin/views/field/TermName.php Displays taxonomy term names and allows converting spaces to hyphens.
TimeInterval core/modules/views/src/Plugin/views/field/TimeInterval.php A handler to provide proper displays for time intervals.
TranslationLink core/modules/content_translation/src/Plugin/views/field/TranslationLink.php Provides a translation link for an entity.
Url core/modules/views/src/Plugin/views/field/Url.php Field handler to provide simple renderer that turns a URL into a clickable link.
UserData core/modules/user/src/Plugin/views/field/UserData.php Provides access to the user data service.
ViewsField core/modules/views/src/Annotation/ViewsField.php Defines a Plugin annotation object for views field handlers.