Are you one of many that has tried to create a listing for your clients CPTs and want to have the possibility to add a link to a PDF that opens in another tab?
After a long search and many tests, I found this method that works:
In your cpt, add a meta field repeater type. In my case I added 2 internal fields: document name (text) and file upload (media)
then in your listing or template you have to use the “dynamic repeater” widget, choose your repeater in the source and then in the “item format” box add: <a href="/en/%file|file_url_by_id%”/" target="”_blank”" rel="”noopener" noreferrer”>%media-name%</a> note that there is no ” after the href= if you put it, the link won’t work..
After that all you have to do is style it as you wish ;)
B.Wired di Bersier Benoit Jonathan © 2019 All Rights Reserved
Questo sito fa uso di cookie per migliorare l’esperienza di navigazione degli utenti. Può conoscere i dettagli consultando la nostra privacy policy qui. Proseguendo nella navigazione si accetta l’uso dei cookie; in caso contrario è possibile abbandonare il sito.