Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-08 14:03:00

azw
Member
Registered: 2007-01-29
Posts: 279

[request] Upload doc & create article via combined input page or via bulk csv

I’m creating a site that will house hundreds of historical PDF documents.

Some of the documents have multiple pages and each page is a separate PDF. These related PDFs should all be related to the same article, description, etc.

I want to upload the PDF (or PDFs) and create an article about the original document at the same time. Much of the info (categories, date, title, description, etc.) will be the same.

The vanilla Txp program would require us to handle the PDF document (s) and the creation of the related article separately. I think we can do it more easily by having one combined data entry page that allows us to do all of this on one data entry page:
  1. enter data about the PDF (or PDFs) related to one original document
  2. upload the PDF (or PDFs)
  3. create an article about the original document

There will have to be a custom field for the date of the original document. These dates will be in the 1940s (which I think is earlier than what Txp’s usual article date can be set to).

Alternatively, we could enter the data in bulk by spreadsheet or a csv file. Would that method be easier? (Remember, though, that there is a many-to-one relationship between the several PDFs and one article.)

Is there a solution like this already? If not, would anyone be willing to try creating it

Last edited by azw (2008-07-08 15:33:01)

Offline

#2 2008-07-08 15:32:27

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [request] Upload doc & create article via combined input page or via bulk csv

My gut would be to upload all the PDFs through TXP’s file mechanism, (or even simply to an unmanaged subdirectory from web root) then associate them to the article through a custom field called “PDF_name” (similar to “article image”).

But I’m not sure I quite understand your scenario.

Also related

Offline

#3 2008-07-08 16:08:28

azw
Member
Registered: 2007-01-29
Posts: 279

Re: [request] Upload doc & create article via combined input page or via bulk csv

Thanks for your reply, MrDale.

Yes, I’m following your thread with great interest.

I had considered just placing the PDF files in an unmanaged directory, but we need to be able to search them, since there will probably be 1000 of them. Also, given that there are so many PDF files, I’m looking for a way to simplify and streamline the process of entering the data.

I had also considered using only the built-in file management system (and not writing articles for each original document). But then it’d be harder to search them because files have a very limited number data fields compared to articles. Files can only be related to one category, and have no custom fields or title.

What does Google see in relation to files? It looks like they might see a listing of files, with only a description and category listed. It’d certainly see less than with articles.

Last edited by azw (2008-07-08 16:27:10)

Offline

#4 2008-07-08 17:26:26

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: [request] Upload doc & create article via combined input page or via bulk csv

I’ve not tried this myself so can’t speak from my own experience but maybe smd_remote_file could help you, maybe also in combination with smd_each.

smd_remote_file allows you to store your files in another location but handle them through textpattern.

smd_each let’s you iterate over a list of items separated by some kind of separator, so if you were to use an article to describe your main download and a custom field with a comma-separated list of file-IDs, e.g. a custom field called article files which contains 21,22,23,24,25,26,32,34,39 then you could use smd_each to generate a download list based on that custom field (this is analog to the approach used for article images).

Another approach might be to make a file category per book and apply that to all relevant files, then use txp:file_download_list (or another related plugin) to list files from that category only. I’m not sure how much control you have over file order, though. Also, if you’re using file categories for another purpose already, this won’t be ideal.

Actually, after having written all that, I vaguely remember that upm_file already does something along the lines of linking multiple files to an article.

Perhaps these are at least some pointers for further research.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2008-07-10 01:48:19

azw
Member
Registered: 2007-01-29
Posts: 279

Re: [request] Upload doc & create article via combined input page or via bulk csv

Thanks, Jakob, that’s good info. I appreciate your help!

It’s ironic, but when I told my partner about upm_file, he said that we could just combine the multiple PDFs so that there is just one per document. Okay! That’ll make the process easier.

I’m thinking I might FTP the PDF files to the servers and then do a bulk upload of file data to the database using a CSV file. We can worry about creating the articles later.

Google sees the file descriptions when you just have the files listed on a page, doesn’t it?

Last edited by azw (2008-07-10 01:50:24)

Offline

#6 2008-07-10 07:40:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: [request] Upload doc & create article via combined input page or via bulk csv

Google sees the file descriptions when you just have the files listed on a page, doesn’t it?

You mean the pdf’s own internal description? Yes, AFAIK google will protocol all text in the PDF providing you haven’t protected it.

If you mean txp’s file description, if you display it in your file listing google will see it. It’ll need to be in your file form (txp:file_download_description – I think it’s not in the default “files” list form but it’s easy enough to add. Either add it to the default “files” form or make your own form and specify it with form attribute in txp:file_download_list.

we could just combine the multiple PDFs so that there is just one per document

Sure, that’s much easier!


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB