Hi there.
I have a list of files (pdfs) uploaded to my site but it text rendered shows the whole file path, eg. hidden link.
Is there a way to only display 'filename.pdf', not the path.
Thanks. Gavin.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Gavin,
Thank you for contacting our support forum.
From our documentation the field should default to displaying the filename as a url. Please see the document below for further options for the file fields.
https://toolset.com/documentation/customizing-sites-using-php/functions/#file
Let me know if this helps.
Thanks,
Shane
Hi Shane - thanks for getting back to me.
I don't want to show the url (hidden link), but just the filename (filename.pdf).
Thanks. Gavin.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Gavin,
This is strange, it seems we found a bug on the shortcode. The shortcode should just display the filename as a link to the file itself.
What i'm going to do is to report this issue to our development team because it's not consistent with our documentation.
However what you can do is to use the title attribute as a workaround to prevent the file url from coming up.
[types field="file-upload" link="true" title='test'][/types]
Let me know if this helps.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Gavin,
I must apologize for the lengthy delay.
It seems the issue here is actually an error in our documentation.
Any solution will require a custom solution to parse the url and strip it.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Gavin,
A customer shared some custom code with us that proves useful to your case.
Have a look at it in the link below.
https://toolset.com/forums/topic/another-vote-for-showing-filename-only-in-list-of-attached-files/#post-384962
Thanks,
Shane