Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#131 2011-07-28 22:29:30
- lithium002
- Member
- Registered: 2011-04-29
- Posts: 25
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
Hi Mary!
Not sure if you still provide support for this plugin but if you do, your response will fix my nightmare!
I’m trying to display files from a files category within an article. I’m using a custom field within the article that contains the files category name.
I’m using then following code:
<txp:if_custom_field name="file_category">
<txp:upm_file_article category='<txp:custom_field name="file_category" />' />
yes
</txp:if_custom_field>
The yes appears meaning the article does have the custom field, but none of the files, if any associated with the article, will display. I know I’m doing something very simple wrong. Any ideas?
Thanks a bunch!
Last edited by lithium002 (2011-07-28 22:29:52)
Offline
#132 2011-07-29 03:58:48
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
Wrong tag and attribute: you want to use upm_article_file_list
with file_category
.
Offline
#133 2017-10-20 06:51:21
- quiris
- New Member
- Registered: 2015-12-31
- Posts: 8
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
After upgrading Textpattern to 4.6.2 the upm_article_file_list tag throws errors similar to:
<b>Fatal error</b>: Uncaught ArgumentCountError: Too few arguments to function file_download_link(), 0 passed in /bip/textpattern/publish/taghandlers.php(4337) : eval()'d code on line 1 and at least 1 expected in /bip/textpattern/publish/taghandlers.php:4794 Stack trace: #0 /bip/textpattern/publish/taghandlers.php(4337) : eval()'d code(1): file_download_link() #1 /bip/textpattern/publish/taghandlers.php(4337): eval() #2 [internal function]: php(Array, 'echo file_downl...') #3 /bip/textpattern/vendors/Textpattern/Tag/Registry.php(83): call_user_func('php', Array, 'echo file_downl...') #4 /bip/textpattern/lib/txplib_publish.php(514): Textpattern\Tag\Registry->process('php', Array, 'echo file_downl...') #5 /bip/textpattern/lib/txplib_publish.php(463): processTags('php', '', 'echo file_downl...') #6 /bip/textpattern/lib/txplib_misc.php(1782) : eval()'d code(87): parse('<a href="<txp:p...') #7 [internal function]: upm_article_file_list(Array, NULL) #8 /bip/textpattern/vendors/Textpattern/Tag/Registry.php(83): call_user_func('upm_arti in <b>/bip/textpattern/publish/taghandlers.php</b> on line <b>4794</b><br />
Any suggestions?
Offline
#134 2017-10-20 08:41:47
- jakob
- Moderator
- From: Germany
- Registered: 2005-01-20
- Posts: 3,253
- Website
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
upm_file is very old. Can you post the form you are using with upm_article_file_list and the output you expect to receive and we can perhaps suggest a replacement that uses the regular txp tags?
TXP Builders – finely-crafted code, design and txp
Offline
#135 2017-10-20 10:55:44
- etc
- Developer
- Registered: 2010-11-11
- Posts: 3,043
- Website
Offline
#136 2017-10-20 12:16:48
- quiris
- New Member
- Registered: 2015-12-31
- Posts: 8
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
jakob wrote #307480:
upm_file is very old. Can you post the form you are using with upm_article_file_list and the output you expect to receive and we can perhaps suggest a replacement that uses the regular txp tags?
Thank you for the tip. I replaced upm_article_file_list with following code:
<p>Do pobrania:</p> <txp:file_download_list id='<txp:custom_field name="pliki" />' wraptag="ul" break="li"> <txp:file_download_link> <txp:file_download_description /> </txp:file_download_link> </txp:file_download_list>
It works fine now :)
Offline
#137 2017-10-20 16:58:06
- jakob
- Moderator
- From: Germany
- Registered: 2005-01-20
- Posts: 3,253
- Website
Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.
quiris wrote #307482:
I replaced upm_article_file_list with following code…
Yes, exactly what I was thinking. Well done!
TXP Builders – finely-crafted code, design and txp
Offline