Hi, I've embedded several images in a node using Media and Media button.
The images are linked to their content/entity.
The images display ok but I also need to add an attribute to their links (the FID) so I thought overriding theme_link() would achieve this.
It turns out that it only works if I flush cache.
If I save the node and go view it, the attribute is not added.
If I flush all caches and view the node, the attribute is there.
Steps to reproduce:
Override theme_link in your code and add any attribute to the link (based on the linked entity)
Insert image into node with wysiwyg and media button
View node (attribute not added)
Flush all caches
View node (attribute is there)
Drupal 7.24
Media 7.x-2.0-alpha3+5-dev
File Entity 7.x-2.0-alpha3+5-dev
Comments
Comment #1
cato commentedThat's what you get for making typos and not reading source code properly...
To get the fid attribute on the links I added the following override function in a custom module:
This could also be used to add accessibility options on the links such as titles and other goodies.
Comment #2
cato commentedAssigning to me, marking as WAD and closing.