Skip Navigation

[Resuelto] How to display title of file instead of URL

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
The issue here is that the customer wanted to display the title of a pdf file using our shortcodes.

Solution:

Unfortunately this is not possible and the closest to get to this is a solution that is a workaround .
https://toolset.com/forums/topic/add-custom-title-for-each-file-i-upload-and-display-the-title-and-link-to-file/

This support ticket is created hace 7 años, 1 mes. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: ,

Este tema contiene 6 respuestas, tiene 2 mensajes.

Última actualización por davidR-12 hace 7 años, 1 mes.

Asistido por: Shane.

Autor
Mensajes
#578187

I have a page here:

enlace oculto

You can see the associated downloads in the sidebar which are files displayed via shortcode. How do I display the title of the media item instead of the URL? My current shortcode is:

[wpv-for-each field="wpcf-posts-downloads"]
<p>[types field='posts-downloads' link='true' separator=''][/types]
</p>
[/wpv-fo

regards,

David

#578269

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi David,

Thank you for contacting our support forum.

I took a look at this for you and it seems the shortcode itself is not able to display the title .
However you can define a custom title when you are using the Title attribute for the shortcode.

Please let me know if this helps.
Thanks,
Shane

#578298

Hi Shane,

Correct me if I am wrong but then the title would be the same for all of the files as they are looped through. Is that right? If so I need a way to set the title for each of the files as they are looped through by the wpv-for-each loop.

David

#578331

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi David,

Yes that is correct.

Will the information be added through CRED ? or any frontend means or is it that the information will be created through the backend.

There might be an alternative for this if the information is done through the backend.

Thanks,
Shane

#578456

Hi Shane,

Its through the backend.

David

#578545

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi David,

The best thing I can recommend is to use a child cpt to hold the files.

This way you can easy display the file title as well as the file itself. Take a look at the link below where Luo was assisting a custom with a similar issue.
https://toolset.com/forums/topic/add-custom-title-for-each-file-i-upload-and-display-the-title-and-link-to-file/
Please let me know if this helps.
Thank,
Shane

#578571

Hi Shane,

I thought you might say that. I hoped there was an easier way but so be it.

Thanks for your help.

David