Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to have token replacement for image fields in views.
It would be nice to have token replacement for image fields in views.
Comments
Comment #1
13rac1 CreditAttribution: 13rac1 commentedI don't know if I understand this feature request. Can you describe in more detail what you'd like?
Comment #2
Lukas von BlarerHm... This was a while ago, but if I recall it correctly, I wanted to specify alt and title attributes in views on a image field using tokens.
Comment #3
srobert72 CreditAttribution: srobert72 commentedSame request, I would like to specify ALT and TITLE attributes in Views using tokens and replacements available with view fields.
Comment #4
13rac1 CreditAttribution: 13rac1 commentedCan you explain how this would work (in the UI, not in the code)? I don't know if I understand this request. Step-by-step please.
Comment #5
Lukas von BlarerWhen adding an image field in views, I would like to be able to specify these attributes in the field config. There would be two text fields to do that where one could input static text and use token replacements from the current row.
As a workaround one could just render the file entity where this is already possible. So now I see that this is not a very urgent thing...
Comment #6
srobert72 CreditAttribution: srobert72 commentedI have Photo content nodes with ImageField.
A Photo node is linked to others Content nodes by EntityReference fields.
I have Views to select and display Image contained in Photos nodes.
I can write ALT and TITLE from ImageField but that is not what I want.
For me ALT and TITLE depend on nodes linked by EntityReference.
So I select EntityReference fields in my views. So I have available tokens in view row with EntityReference fields.
I'd like to use values from these tokens to write ALT and TITLE attributes.
Comment #7
Jose Reyero CreditAttribution: Jose Reyero commentedInterested in this feature too, in addition to #1934986: Alternate approach: replace tokens on the fly. We need some proper field formatter for it to be used on views.