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.

How to group by a channel field?

May 10, 2011 8:14pm

Subscribe [3]
  • #1 / May 10, 2011 8:14pm

    three80

    15 posts

    Is there any way to do the following either out-of-the-box or with an addon:

    Say I want to aggregate content about cars.  For each car, I want to show links to reviews, photos and videos.

    On the page for a given car, I want to group the links by the link type - show all links to reviews together, then all links to photos, then all links to videos.

    I’m familiar with fundamental EE site design but I have no idea how to do this.

  • #2 / May 10, 2011 9:56pm

    Rob Allen

    3105 posts

    That really depend how you have your different channels, categories, statuses etc set up.

    How are you calling info for each car type, does each car have it’s own channel entry? Are reviews, photos, links etc in their own Channels?

  • #3 / May 10, 2011 10:20pm

    three80

    15 posts

    All hypothetical at this point.  I’m trying to determine if EE can, in any way, do what I need.  Is there some type of arrangement of channels and categories that I could configure to accomplish this?

  • #4 / May 10, 2011 10:34pm

    Rob Allen

    3105 posts

    OK, there are several ways to approach something like this but I’d probably go down the route of having separate Channels for each content type, then pulling in related info using “related_entries” and “reverse _related_entries” tags.

    So something like this:

    A Channel for car types
    - includes various custom fields for specific info for that particular car

    A Channel for reviews
    - includes a custom field for the URL/site where the review was published
    - you could also use this Channel to publish your own reviews
    - includes a custom “Relationship” field to associate the review with a car type from the Cars Channel

    A Channel for photos
    - includes a custom field for the image/photo + description, caption etc
    - includes a custom “Relationship” field to associate the review with a car type from the Cars Channel

    A Channel for videos
    - includes a custom field for the video file, Youtube URL etc + description, caption etc
    - includes a custom “Relationship” field to associate the review with a car type from the Cars Channel

    Once you have all that set up, in your “cars” template you’d then pull in reviews, links, photos etc using “reverse_related_entries”. So if I’m looking at an Aston Martin DB6 page (I wish…lol) I’d then be able to see any related links, photos and videos you’ve added about DB6’s.

    Does that help?

    PS - Might also be useful to think about grouping content by manufacturer as well, for that I’d probably opt to use Categories for manufacturers.

  • #5 / May 11, 2011 10:26am

    three80

    15 posts

    Very helpful.  Thank you.  I had no idea reverse related entries even existed.

  • #6 / May 11, 2011 11:26am

    you might also take a look at playa from pixel and tonic. it makes dealing with related and reverse related entries a bit easier and a good deal more functional.

  • #7 / May 11, 2011 11:29am

    Boyink!

    5011 posts

    An alternative for the photos and videos would be to use Matrix which would allow multiple photos & videos to be added per entry.

    I do a similar thing on our travel site (see the tabbed area at the bottom):

    http://boyinks4adventure.com/our-travels/ringing-rocks/

    Typically I’d look to native EE abilities but in this case the speed of content entry would be drastically improved using Matrix.

    Reviews might be another issue - involving other member logins etc.  They would still get their own channel I think.

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

ExpressionEngine News!

#eecms, #events, #releases