I have a View that lists entities. One of the fields is the entity label field, which is set to output a link to the entity itself. I would like to add attributes to the <a>
tag to grab later with a jQuery plugin.
I can use template_preprocess_views_view_field()
and hook_views_pre_render()
to get the rendered markup and alter it there, but it's very dirty and not something I'll consider. I could also create a specific theme suggestion and field template and do it that way, but I don't want to rely on something that's potentially editable or changeable. It needs to be as generic as possible.
Is there a clean solution for this?