representative_image
303 sites
Security covered
Allows you to define representative image or media fields for entities like nodes, taxonomy terms and the like. These can then be used in Open Graph meta tags (via tokens); as fields in views; or embedded as tokens. The media module is also supported. A default image can be defined for those entities without images.
Drupal 8
Defines a field of type Representative Image that you can add to bundles (like content types, user accounts, comment types, etc) and define which image field should be used for display plus what to do when there is no image.
Once the field is configured, you can use it in display modes, views, and embed it as a token. See the screenshots for a few examples.
Drupal 7
Features
- A setting in admin/structure/types/manage/my_content_type allowing you to select a representative image field. For example, for articles the representative field might be image, but for some other content type it might be logo, etc.
- A token [node:representative_image], which you can use anywhere you use tokens, which gives you a full URL to that Image. If you don't need a token, you can also use the representative_image() function. Tokens can the be used with Metatag Open Graph module to display, in the og:image meta tag, a representative image for your node, which might be different per node type.
- Support for image fields, even when using the media module (>= 2.x).
The initial version of this module was sponsored by TP1 in Montreal.