Skip Navigation

[Résolu] Remove file url link on front end, just have a title

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.

This topic contains 8 réponses, has 2 voix.

Last updated by Waqas Il y a 6 années et 10 mois.

Assigned support staff: Waqas.

Auteur
Publications
#273240
Screen Shot 2015-01-03 at 10.44.07 PM.png
Screen Shot 2015-01-03 at 10.43.52 PM.png
Screen Shot 2015-01-03 at 10.43.22 PM.png

I am trying to: upload files so that users can download them on the front end. However, the files on the front end have long ugly urls.

I visited this URL: I don't get this question or the point to it. I'm working locally.
I expected to see: "application form", "business plan", "company profile" or whatever file i'm uploading for the service. I think that there are too few fields for the "File" field as i can only upload a file but I would like to create a title that is linked to the file.

Instead, I got: "hidden link" as a link instead of "Application Form". How do I create this?

[types field="related-documents" link="true" separator=", "][/types]
#273461

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

File field only keeps track of the URL to the uploaded file, and returns the same. For your particular need, I will suggest you to take advantage of Fields Table, where you can create a child post type to group custom fields and can utilize within your parent (main) CPT. This way, you can define additional fields for your files (such as Title, Description and etc). And then, can list 'em as needed on your main view.

The user guide at https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/ describes about "Creating Groups of Repeating Fields" for this purpose.

While, following articles address about displaying these in your main view:

- https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
- https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/

Please let me know if I can help you with anything related.

#273663

In your first paragraph, I only understand the first sentence. I don't even know what to ask in order to seek clarity. I know how to create a child post type as I have a number of them in my system. I do struggle to understand how they will be used in this context and how they will rename files.

Based on your first sentence of how the file field only keeps track of the url of the uploaded file and returns that, can you show/tell me examples where the file field is used in a way that is useful and aesthetically appealing? Maybe i'm not using it correctly.

#273792

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

This link https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/ explains it very well, with an example. You can follow this to create only the fields required (i.e. Title and File Field).

#273929

I have read it, I understand it but I don't get how its supposed to solve my problem.

#274067

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Can I ask you for a temporary access to your site? So I can create a demonstration for you. Which you can further follow to extend or can understand to use with your existing stuff.

I have enabled your next reply as private, please input all details in that area. Also remember to take backup of your site.

#274069

I don't mind giving you access to my site, i just don't know how to give you access. Please tell me or send me a link of video that will explain how its done.

#274078

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Pardon me for skipping the private are for the details in my previous message.

I have enabled your next reply as private, please input all details in that area. Also remember to take backup of your site.

#274253

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Looks like you have given access to your local host, which can't be accessed in any way.

However, I have created a demo for you at hidden link

You can see a couple of companies listed there. And each company has some "Files" listed under company logo and description. Please notice, that in the files list, each item is displayed with different title, while clicking the title will open the file.

I achieved this by 2 CPTs and 2 Views as below:

1. I created a parent CPT named "Companies". This CPT has just a few default/standard fields - Title, Description (post content) and Featured Image (for logo).

2. I created a child CPT named "Company Files". Attached this CPT to it's parent "Companies". This CPT has a standard Title filed and a Custom Field "file" (for file upload).

3. I created a child view named "Company Files" to list just the posts from CPT "Company Files" (Title encapsulated in A tag with File URL). I filtered the view on "Select posts that are a children of the Post set by parent View.". Because I will use this view within it's parent view (see next step #4).

4. I created a parent view named "Company Listings" to list posts from CPT "Companies" (Title, Description and Logo). I then inserted the child view (#3) within the loop also. So when this view is rendered and it lists all companies, it also grabs the output of "Company Files" view.

Finally, I inserted the parent view in a page named "Companies" (hidden link), so I can see the output.

You can experience all this demo at above mentioned URL. I am sending you WP Admin access to your email address, so you can login and see how the CPTs and Views are setup.

I hope this explains it in very much detail and issue is resolved.