Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-15 12:16:23

milkshake
Member
From: Linz, Austria
Registered: 2007-06-24
Posts: 80
Website

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

  1. 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.
  2. 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

#2 2007-11-15 18:30:52

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

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

#3 2007-11-16 09:56:59

milkshake
Member
From: Linz, Austria
Registered: 2007-06-24
Posts: 80
Website

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

#4 2007-11-19 20:57:58

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: mlk_images_to_articles -- call for developers

this looks promising! I could definitely use this


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#5 2007-11-19 21:25:01

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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

Board footer

Powered by FluxBB