ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Multiple images per category?

July 18, 2011 10:50pm

Subscribe [5]
  • #1 / Jul 18, 2011 10:50pm

    AllanW

    37 posts

    Greetings. I see that categories have a field for a single image; I’d like to associate multiple images with a given category. So, one, is that possible?

    Second path, some of which I’ve seen hints of in the forums: create a channel for images (“category-images”) with just images in it. Trying that - how do I then add those to a category page within an exp:channel:entries tag? Sounds like nesting channel:entries is a no-no.

    Should I do this with related entries? I don’t want to have to deal with it in the publish layout, just in the template itself. What tag, then? I don’t see how to associate a different channel within a related entry tag.

    Probably a noob question - I’m back in EE after a 3-year hiatus (I started back in the pMachine days:). Suggestions? Thanks!

  • #2 / Jul 19, 2011 1:44pm

    Boyink!

    5011 posts

    A few ideas:

    1. You can create custom category fields, so possibly do that to load more images.

    2. If you create two channels that share the same category group, then you can use two separate channel:entries loops (not nested, but side by side) on the same template and if that template is loaded at a category URL both loops will filter to show entries in that category.

    3. Look at the reverse related entries tag for relationships - it’s the handier side of EE’s native relationship abilities.

    Welcome back..looks like you joined about the same time I did..😉

  • #3 / Jul 19, 2011 1:58pm

    AllanW

    37 posts

    Hi Mike! Thanks for responding. I think I’ll look into Category fields, didn’t know you could do that!

    I feel like the “dictionary” for conversing in this strange tongue (“eeeh-eeeh”) has multiplied many times since 1.0. So many ways to say, “multipleimagesincategories!”

  • #4 / Jul 19, 2011 2:12pm

    Boyink!

    5011 posts

    Yep - between EE’s native abilities and the Add-on aftermarket much has happened in that three years.

    The other thought - depending on your content requirements - is using Matrix to allow storing of multiple images per entry.

    I do this on our Travel site (see bottom for images):
    http://boyinks4adventure.com/our-travels/tidepooling-at-tongue-point/

    With this approach you can almost think of an entry as a “category” - and use standard channel fields to do the description of the parent content while still allowing multiple/unlimited child photos.

  • #5 / Jul 19, 2011 4:31pm

    AllanW

    37 posts

    I considered Matrix and Channel Images - both are impressive and I’ll likely purchase in the future. For now, that’s overkill. There’s 6 categories that won’t change (don’t they always say that? =), so I don’t need a large-scale solution.

    I see that category fields are very simple, without all the other fieldtypes. Wish I could have a “file” fieldtype; oh well, I’ll just paste the image URLs.

  • #6 / Jul 19, 2011 6:33pm

    Brandon Jones

    5500 posts

    Thanks Mike! Is that solution working for you, Allan?

  • #7 / Jul 19, 2011 7:10pm

    AllanW

    37 posts

    Thanks Mike! Is that solution working for you, Allan?

    Using Channel Custom Fields I think will work, however it’s quite tedious to do so. I was hoping for more fieldtype choices in the custom category fields (just text and textarea). I’m about to test the rendering of those custom fields, I think the docs cover that.

    I did find an Image Category Manager that helps with this. However, it only works within a publish entry, which I guess is okay in this instance. I haven’t tried it yet, I just added the image paths manually.

    I’m sure there’s a slicker way to do it. If I’d had 20 or member-added categories to deal with, I’d for sure look to something more robust. In this case, it’s done and they won’t change.

    Thanks guys - will let you know if my rendering part has issues.

  • #8 / Jul 20, 2011 6:25pm

    Sue Crocker

    26054 posts

    Hi, AllanW. How are you getting along? Just checking in.

  • #9 / Jul 20, 2011 7:18pm

    AllanW

    37 posts

    Hi, AllanW. How are you getting along? Just checking in.

    Hi Sue! It’s been a long time. I did get it to work successfully, though as I mentioned above, getting the file paths into category fields is less than elegant. I essentially uploaded them using the file manager, then opened an entry to select each image and copy the file paths.

    For a site with limited categories, this is acceptable. However, if I was doing a site with many categories (or ones that are added all the time) I’d look into perhaps a “category images” channel and a relational field, or some kind of add-on like Channel Images.

    Is there a way to add other fieldtypes (File, etc.) to the category fields? Because that would really solve the problem. The two add-ons that do only work in a Publish entry context.

  • #10 / Jul 22, 2011 3:43pm

    Brandon Jones

    5500 posts

    Is there a way to add other fieldtypes (File, etc.) to the category fields? Because that would really solve the problem. The two add-ons that do only work in a Publish entry context.

    Not currently, but we do eventually want to see everything moved over to the Fieldtype API, including category and member fields. Stay tuned. Sounds like you have a solution for now - don’t hesitate to post again if anything else comes up!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases