Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-05 15:15:20

knighterrant03
New Member
From: Dublin
Registered: 2007-05-14
Posts: 7

File Downloads Per Article

Hi, i’m in a bit of a bind here. Does anyone know of a way to store the id of a file to be downloaded in a custom field and then call that id for each individual article, so i don’t have to hard code in specific file id’s? I basically want it to work like the “Article image” field on the Write page in Admin.

Thanks in advance :)

Here’s what i have:
custom field =“Download_name”

========Sidebar form==========
<!— start context menu—>
<div id=“logo_grey”><img src=”../images/RP_grey_logo.jpg” alt=“logo grey”/></div>

<div id=“details” class=“contextmodule”>
<h4>Latest Commercials</h4>
<txp:recent_articles label=”“ wraptag=“ul” break=“li” section=“commercial” limit=“4” sortdir=“desc”/>
</div>

<div id=“download” class=“contextmodule”>
<h4>Download Video</h4>
<txp:output_form form=“files” />
</div>

<!— end context menu —>

========files form==========
<txp:text item=“file” />:
<txp:file_download_link id=“<txp:custom_field name=“Download_name” />”>
<txp:file_download_name /> [<txp:file_download_size format=“auto” decimals=“2” />]
</txp:file_download_link>
<br />
<txp:text item=“category” />: <txp:file_download_category /><br />
<txp:text item=“download” />: <txp:file_download_downloads />

Last edited by knighterrant03 (2007-07-05 15:21:34)

Offline

#2 2007-07-05 15:32:33

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: File Downloads Per Article

You can easily do it with Mary’s upm_file.

I got it working on a client site.

Z

Offline

#3 2007-07-05 15:52:38

knighterrant03
New Member
From: Dublin
Registered: 2007-05-14
Posts: 7

Re: File Downloads Per Article

Thanks i’ll try that!

Offline

#4 2007-07-05 16:07:42

knighterrant03
New Member
From: Dublin
Registered: 2007-05-14
Posts: 7

Re: File Downloads Per Article

It took a bit of skull sweat to get my head around that but it work brilliantly! Thank You, your a legend!

Offline

#5 2007-07-06 09:54:17

knighterrant03
New Member
From: Dublin
Registered: 2007-05-14
Posts: 7

Re: File Downloads Per Article

I keep getting an error msg on the pages that use upm_file:

An error occurred in the following tag: <txp:upm_article_file_list/> -> Textpattern Warning: Unknown column ‘BCI_COPS_Irish.mpg’ in ‘where clause’
select * from txp_file where id in(BCI_COPS_Irish.mpg) order by field(id, BCI_COPS_Irish.mpg) on line 84

Notice: missing_article_tag: commercial in /Applications/MAMP/htdocs/redpepper/textpattern/publish.php on line 462

Offline

#6 2007-07-06 10:14:24

knighterrant03
New Member
From: Dublin
Registered: 2007-05-14
Posts: 7

Re: File Downloads Per Article

got the first part sorted, and i feel a little stupid but i still get:

Notice: missing_article_tag: commercial in /Applications/MAMP/htdocs/redpepper/textpattern/publish.php on line 462

Apparently its because there is no article tag in the page template, but shouldn’t ump_file’s article tag replace this? Is it a bug?

Offline

#7 2007-07-06 10:26:59

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: File Downloads Per Article

You have to put upm_file’s tags inside a form, and use the txp:article tag in the page template calling that form. It’s a bit tricky at first, but by trial and error you should figure it out.

Z-

Offline

Board footer

Powered by FluxBB