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.

Filtering Results Channel:Entries

May 17, 2012 4:06pm

Subscribe [2]
  • #1 / May 17, 2012 4:06pm

    MW

    2 posts

    I’m an EE noob, but have a lot of experience working with Drupal, Wordpress, and back in the day I rolled my own CMS quite a bit. I’ve done some hunting around the forums, wiki, and user guide and have struck out finding an answer for a pretty basic question (which may be way I’ve struck out).

    I just want to filter the entries of a channel based on a key/value pair.

    This is my channel code in the template:

    {exp:channel:entries channel="boxes" limit="3"}

    I just want to add something like “WHERE position=“left”. The expression engine equivalent to:

    SELECT * FROM somewhere WHERE something="boxes" AND position="left" LIMIT 3

    Position is a channel field (select list) with options for left, middle, and right.

  • #2 / May 17, 2012 6:02pm

    MW

    2 posts

    Possible answer my own question:

    I was thinking about it, or a work around, and that would be to create 3 different channels, one for the left, middle, and right. Then include the same field group into each channel. Which from what I’ve read, is pretty much the purpose of field groups.

    I’d just like to reduce confusion for the user by reducing their options when creating and editing content.

    So, is that the answer? Create 3 channels and use field groups as opposed to one channel and filtering by a field’s value?

  • #3 / May 18, 2012 3:38am

    artminister

    159 posts

  • #4 / May 18, 2012 11:57am

    MW

    2 posts

    That’s exactly what I needed. Thank you so much.

  • #5 / May 18, 2012 2:16pm

    Shane Eckert

    7174 posts

    Hey torqed,

    I am glad to see that the community was able to help you out! That is so AWESOME!

    Have a great weekend!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases