Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
mlk_images_to_articles -- call for developers
Hello :)
I’m currently trying to develop a plugin which creates articles based on and linked to images in a given directory.
Maybe a couple of use cases will help explain it…
Use cases
- You need a medium-to-large product catalogue for your site. Each product has an image. You want the flexibility of having each product as it’s own article, but you really don’t want to manually create hundreds of articles, then hand link them to their product image.
- The same again, but with other file types instead of images — think pdf, mp3, zip/tar, etc, etc
How it should work
- Scans your file directories, gives you a choice which to import, imports each file as its own article
- Intelligently parses filename for useful info that can be mapped to txp fields (body, custom fields, categories etc.)
- Extracts meta data (e.g. exif) that can be mapped to txp fields as above
- Recognises which files it has already imported
- Dynamic — deleting an article deletes the file, deleting a file deletes the article
- Flexible enough to import other file types
The dream
- An importer for mass-creation of txp db objects. Word docs to articles, CSV to users. Basically world domination with blue M&M’s on top.
Get real
I have some working code which does the first bit — scans your image directory, asks you what you want to import, creates articles for each with the article_image field populated with an absolute path to the image.
The code is crudely modified from fpx_image_import, it just creates articles instead of images (the function names are even still the same at the moment (>_<)
Give it a whirl — http://mlk-images-to-articles.googlecode.com/svn/trunk
Note: It’s uncompiled, so you will need to follow these steps to install it
Roadmap!
Shout if anyone’s interested in working on this together.
At the moment I’m hoping to focus on image import, with other file types following later.
Last edited by milkshake (2007-11-16 10:08:54)
Offline
Re: mlk_images_to_articles -- call for developers
Sounds like a job for [trumpets] xPattern … seemed like a good idea at the time.
Seriously though… I think this idea is a good one. Good work milkshake.
I’m not sure how I feel about the actual images not being handled by the database. Perhaps it could automatically bring the images (or other files) into the images (or files) table?
Last edited by mrdale (2007-11-15 18:31:55)
Offline
Re: mlk_images_to_articles -- call for developers
Thanks for the feedback.
mrdale wrote:
I’m not sure how I feel about the actual images not being handled by the database. Perhaps it could automatically bring the images (or other files) into the images (or files) table?
Understood, but I’ve never been so hot on Txp’s image handling, preferring the elegant ways of Zenphoto.
Zenphoto evangelising
It reads your image directory, creating albums/sub-albums for each folder/sub-folder, and db entries for each image it finds.
There’s a universal config for thumb/large image sizing, which gets applied to all images at runtime (with caching for performance). This method has its drawbacks — only one thumb/large size for all images, but that’s what you want most of the time.
What it basically means is that your source images stay the same — size, filename etc, and reorganising them is as simple as dropping them in different folders.
Not sure if I explained that well, but my point is that I like the idea of the DB just pointing to the source images, adapting based on the file structure, and some code doing the grunt work of resizing at runtime.
Realisation
So I guess what I really want is a bridge between Txp + Zenphoto. Hmm…
Well, you would still need to create articles for each image, so I guess this plugin could be a starting point ;)
PS
xPattern is a good idea. I think an XML based CMS is what Dean imagined…
Offline
Re: mlk_images_to_articles -- call for developers
this looks promising! I could definitely use this
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
Re: mlk_images_to_articles -- call for developers
I think an initial implementation that created current TXP images and attached the ids to new articles would a good place to start. The image handling (which is a bigger task) could then be fleshed out separately.
Shoving is the answer – pusher robot
Offline