Skip Navigation

[Resolved] Files – show only document filename, not path

This support ticket is created 8 years, 5 months ago. 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.

Our next available supporter will start replying to tickets in about 0.37 hours from now. Thank you for your understanding.

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)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 8 years ago.

Assisted by: Shane.

Author
Posts
#350235

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.

#350258

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

#350296

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.

#350575

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.

#350578

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Escalated

#357514

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

#386772

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

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.