Hi,
Would it be possible to make Taxonomy Image attach multiple images to the term. My reasoning is to be able to add a separate image for returning to a category listing page, one that has 'back to term' written on it.

I still need to be able to associate an image to represent the category, but a second would be useful. I imagine it could be called by passing a number to the taxonomy_image_display($term->tid) function.
Obviously the images could also be categorized (header, back images etc), to allow easier to read callbacks.

Nice module btw.

Drew

CommentFileSizeAuthor
#7 taxonomy_image.zip51.02 KBnsciacca

Comments

nancydru’s picture

Title: Add multilpe images to a term. » Add multiple images to a term.

Hmm. Interesting concept. It doesn't seem terribly hard to do, but one would need to be careful not to break current implementations.

drew reece’s picture

I had a go at duplicating the module (removing the original) and I hacked around with it. I don't know enough about module writing so I gave up.
I was having to add an additional 'type' field to the term_image table to assign an 'image_type'. I didn't like that it meant items in the term_image table would have duplicate 'tid' fields breaking the primary key in the table.

My current method involves another content type (back button) that gets assigned a category, but its a little confusing to the user who sets the category heading via the 'Categories > Category images' tab and then has to add the back buttons in 'Content > Create'.

I'm steadily working my way through the 'Pro Drupal Development' book and may come back to this at a later date, just not at the moment.

I imagine this feature should really be an extension of the module, like the e-commerce contributed modules, but I have no idea how to implement it.

This module seems to be going in a nice direction, with the patch 'Add taxonomy images to the node automatically' so I though I'd give it some time to let the patches go into the module.

Thanks,
Drew

nancydru’s picture

Well, I would think a sequence field could be added, but would have to become part of the primary key. That part is easy, as is, having you tell the module which sequence number you wanted. The trick is the display on the management page and letting you delete sequence #1 while retaining #2.

I'll be working my way through the issue queue. Things with patches or critical problems will get higher priority, Then I'll look at new features like this or automatic adding. But I will get to every issue - just bear in mind that the original intent of this module was to keep it simple and light-weight, so I may decide not to do some of the requests.

nancydru’s picture

Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

As I get more involved with the code, this is looking more and more difficult, particularly from the management aspect. If someone wants to take a shot at a patch, please feel free; just, please, test it really well.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I've tried coming up with a simple way to do this and the management issues are pretty significant. Since the intent of this module was to remain light-weight, I'm going to mark this as "won't fix." That is a special status that I will revisit from time-to-time and see if I've changed my mind.

drew reece’s picture

Thanks Nancy for looking into it.

It struck me as being overly complex when I tried to add it to the module.

Drew

nsciacca’s picture

StatusFileSize
new51.02 KB

I created a 6.x version to do exactly this. It was pretty easy and didn't add much bulk to the existing code. I basically extended the schema to include another column called "delta" and made the primary key = array('tid', 'delta'). For my purposes I created a drop down with 1-5 options for how many image fields should be available and provided a textfield to name the fields via comma separated list. A few updates to caching and function calls to include delta, I can now call "taxonomy_image_display($term->tid,NULL,NULL,NULL,1);" where the "1" is the delta.

There a few custom modifications and some inline css I added so images would fit nicely in my admin theme (Rootcandy Fixed) - but they can be removed/tweaked and it will still work. I'm posting it here in case anyone else runs across this or is interested in patching it in/porting it back to D5.

Note that I removed the contributed folder and didn't make any attempt to modify these plugins because for my purposes I was directly calling the image display function where I needed it.

UNarmed’s picture

Thanks for the module but i am getting this error when adding images to a term

    * user warning: Unknown column 'delta' in 'where clause' query: SELECT COUNT(tid) FROM term_image WHERE tid=3 AND delta=1 in C:\wamp\www\ftg\sites\all\modules\taxonomy_image\taxonomy_image.module on line 695.
    * user warning: Unknown column 'delta' in 'field list' query: INSERT INTO term_image (tid, path, delta) VALUES ('3', '4.jpg', '1') in C:\wamp\www\ftg\sites\all\modules\taxonomy_image\taxonomy_image.module on line 701.
    * Error while adding image [tid = 3, path = category_pictures/4.jpg].


UNarmed’s picture

It looks great and the views integration is a really nice feature to but the only problem is i get the error above and so they end up not display in views or the taxonomy admin section. The images get uploaded to the correct folder on my server but that is about where it ends.

drew reece’s picture

UNarmed,
This feature request is a couple of years old. You will want to create a new issue because your error is not related (as far as I can tell) to his feature request.
The only reason for posting here would be that your error related to nsciacca's version in post 7 is that the case?

edit: corrected the post number of nsciacca's version.

UNarmed’s picture

Ah ok thanks il open up a new request then =]