• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Change Uploaded file name to text?

TGoodrich

New Member
Hi Everyone,

I am new to Fabrik and have a question concerning file names in the list view.

I want to allow my clients to upload a pdf file and give it a name for the list view.

As an example, say my clients uploads a pdf file called "ordinances035.pdf"

Currently in the frontend list view everyone will see "ordinances035.pdf" . Is there a way to have it appear like "Revised Traffic Ordinances 2015" in the list view?

I have created a form that has 4 fields for my client to fill out, File Upload, Upload Date, Category and File Rename.

If possible how can i set Fabrik up so that it uses the name entered into "File Rename" to replace the pdfs actual name like the example above?

I'm not sure if what I am asking would change the actual name of the file upon upload or if it would use the "File Rename" text to link to the file.

Please Advice Thanks,
TGoodrich
 
Display your description field + fileupload field in list view.
Fileupload set to
link to file = yes
display media in list = yes, this will show a PDF icon instead of filename.
 
Hi troester,

Thank you for your reply but this really is not the solution i am looking for.
I did try your suggestion and what I ended up with was the pdf icon next to the description.
My users will need to click the icon to open the pdf.
I was really hoping there was a way to convert the filename to a text link with my choice of text.

Is seems there should be some way to do this.
When viewing the pdf document link in my list I see:
Code:
<a class="download-archive fabrik-filetype-pdf" title="http://www.staging.mysite.org/uploaded_files/documents/ordinances-policies-regs/Hunting-Firearms_Ordinance.pdf" href="http://www.staging.mysite.org/uploaded_files/documents/ordinances-policies-regs/Hunting-Firearms_Ordinance.pdf">Hunting-Firearms_Ordinance.pdf</a>

It looks like a standard link and it would be great if my client could fill out a text field in the form that gives the option to replace the link name.

Maybe a future addon to Fabrik or code snippet? Maybe add an option in the fileupload element? Kinda like what is found under fileupload > Display > Title Element - Which has a dropdown allowing you to choose a lightbox title using another elements data.

Would be awesome to have a similar feature for the uploaded files name when viewing in a list.
 
You can add a calc element, fetch the description element and fileupload element and compose and return the link you want.
 
You can add a calc element, fetch the description element and fileupload element and compose and return the link you want.

Hi again, I downloaded and installed the calc element but unfortunately i do not know enough about php to mark this up.

I have an upload field for the pdf's named "document_upload" and a text input field named "file_title". Would it be possible to get an example how i would mark up the php in the calc element?

Thanks
 
I have an upload field for the pdf's named "document_upload" and a text input field named "file_title". Would it be possible to get an example how i would mark up the php in the calc element
Fabrik > Elements > Calc Element > Options tab > Calculation markup:
PHP:
return '<a href="'.'{table-name___document_upload}'.'">'.'{table-name___file_title}'.'</a>';
Example:
document_upload = "/uploads/usr_guide.pdf"
file_title = "User Guide"
calc element calculation = <a href="/uploads/usr_guide.pdf">User Guide</a>

After calc element is published, its list will show a link where "User Guide" title is linked to "/uploads/urs_guide.pdf" file.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top