Target=_Blank for Cards report template
I wanted to use the “Cards” report template for a small report which lists file attachments. When the user clicks on one of the cards, the file should download and open in a new tab/window. Unfortunately, the Cards report template does not include a placeholder for extra attributes for the anchor tag, so it won’t let me add “target=_blank” like I would normally.
One solution is to edit the Cards template to add the extra placeholder; however, this means breaking the subscription from the universal theme.
- Set report static ID, e.g. “mycardsreport”
- Add Dynamic Action:
- Event = After Refresh
- Selection Type = Region
- Region = (the region)
- Code =
$("#mycardsreport a.t-Card-wrap").attr("target","_blank");(replace the report static ID in the selector)
- Fire On Page Load = Yes
- Code =
Note: this code affects all cards in the chosen report.