Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-06-17 23:21:06
- liikennevalo
- New Member
- Registered: 2009-06-17
- Posts: 4
Need "File Title" field for file_download link
In creating a list of downloadable files (e.g., PDFs of White Papers, etc.), I need to be able to generate a link to the PDF with the paper’s Title as the text, rather than its unwieldy file name (e.g., “chap1ObjectC.pdf”). Any plugins or mods available that work with 4.0.8? Thanks!
Offline
Re: Need "File Title" field for file_download link
Can you put the actual title in the download description, and then use something like <txp:file_download_link><txp:file_download_description /></txp:file_download_link>?
Offline
#3 2009-06-18 02:27:11
- liikennevalo
- New Member
- Registered: 2009-06-17
- Posts: 4
Re: Need "File Title" field for file_download link
I could, but then I would lose the description of the paper altogether: the desc field would be the linked text (with the Paper’s title) and the one sentence long description would have nowhere to go. Basically, I need two fields instead of just one.
Offline
Re: Need "File Title" field for file_download link
There are times when it would be useful if there were a title, categories, and keywords fields for links, files, and images. (And a link image and file image field :D)
There’s a very old hack that might get you started in adding a custom field
txp:variable could act as a custom field, but without being able to associate each variable with the corresponding individual file, it won’t help. (unless there’s some magic code you could cook up with something like smd_if or smd_query or smd_each)
Sorry – just thinking out loud, but not being of much help
Last edited by maverick (2009-06-18 05:11:54)
Offline
#5 2009-06-18 05:41:16
- liikennevalo
- New Member
- Registered: 2009-06-17
- Posts: 4
Re: Need "File Title" field for file_download link
No worries — thanks for the help!
Offline
Re: Need "File Title" field for file_download link
I agree a title and other stuff to associate with an image would be useful.
fwiw, I’ve simply cheated in the past and put the lot in the description field, as HTML, e.g:
description
<h3>Migration habits of the Antediluvian Cheesefrog</h3>
<p>A paper discussing the intercontinental movements of these magnificent creatures.</p>
And then using <txp:file_download_description escape=""/>
to output it. Not pretty, but it works.
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
Re: Need "File Title" field for file_download link
I have gotten around this problem before by using both the files and the links tab. In other words, I upload the file, and then create a link to that file on the Links tab, which has more fields where I can store extra information.
Offline
#8 2009-06-23 14:19:46
- liikennevalo
- New Member
- Registered: 2009-06-17
- Posts: 4
Re: Need "File Title" field for file_download link
I like the solution from Nora: it’s working very well. Thanks a ton for the work around!
Offline