Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-03-29 07:26:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,190
Website

File download title?

The Edit panel for files offers a “Title” field. Is there a way to output the value of that field on the front end? I don’t see any tags for this in the docs.

Idea is to use the download attribute to give the file a more meaningful name once downloaded on the users system, target audience being Japanese users. So you‘d have file_name.zip as uploaded (name field), ASCII characters to avoid trouble on the filesystem, and replace the “file_name” string with something in Japanese for the end user.

<a href="https://example.com/file_download/345/apple.zip" download="アップル.zip">download</a>.

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2017-03-29 07:27:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: File download title?

Try file_download_name with attribute title="1". Bit obscure, I realise now, but I didn’t want to introduce a new tag when the previous modus operandi for name/title was the same in other tags.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2017-03-29 07:36:58

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,190
Website

Re: File download title?

Oh, indeed, the < file_download_name /> tag has a title attribute, I skipped right past it. My bad.

Thanks.

One small problem fixed, dozens more to fix.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2017-03-30 08:27:34

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Re: File download title?

99 little bugs in the code
99 little bugs in the code
Take one down, patch it around
127 little bugs in the code

Offline

Board footer

Powered by FluxBB