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.

Creating properties that make it easy to search/filter

October 30, 2012 12:54am

Subscribe [3]
  • #1 / Oct 30, 2012 12:54am

    xdupChook

    9 posts

    Hi everyone,

    I have a concern about organizing my site (I did several searches on this and wasn’t able to find very clear answers).

    I’m creating a database and want to make it so that entries I create have different properties that I can use to filter search results with. I know that in a normal programming language, I would make a custom object with different properties (such as strings and ints) and have the search based on whether these properties either have the field exactly, are sortable (alphabetical for strings, lowest to highest for ints, etc), contain at least, etc.

    I couldn’t figure out if the best way to do this was with categories or custom fields. I’m assuming that custom fields is the way to go, but I’m not entirely sure how to reference these properties.

    Thanks.

    Bryan

  • #2 / Oct 30, 2012 10:05am

    Boyink!

    5011 posts

    You’ve several options, none of which are really “best” - they are all useful depending on the site and the content:

    Categories (native)
    Tags (add-on)
    Drop-down fields tied to channel:entries using the search parameter (native)
    Search (native)
    Search on steroids (add-ons).

    Knowing more about the site and the intended UI/interaction would help guide the choice here.

  • #3 / Oct 30, 2012 12:57pm

    xdupChook

    9 posts

    Good morning Boyink!

    Thanks for your reply.

    I’m basically creating a database for a trading card game. Each card would have its own entry (unless you there’s a better way to handle this) where I can tag properties such as “Damage”, “Card Cost (in terms of resources within the game)”, “Activation Requirements (must have these particular other cards in order to use)”, etc. I want users to be able to do a generic search by typing in the cards name, but also specify specific properties such as “must deal at least this much damage”, “cost minimum”, “do not include results with this requirement” and also be able to sort results such as by damage.

    Please let me know if I could provide any additional information.

    Thanks again!

    Bryan

  • #4 / Oct 30, 2012 6:13pm

    Boyink!

    5011 posts

    I wonder if http://www.solspace.com/software/detail/super_search/ might be a good solution?

  • #5 / Oct 31, 2012 12:49pm

    Shane Eckert

    7174 posts

    Hey xdupChook,

    What do you think of Mike’s latest post?

    Thanks so much for the help this week Mike, been enjoying your threads.

    Cheers,

  • #6 / Oct 31, 2012 2:25pm

    xdupChook

    9 posts

    Thanks for the suggestion and reply, Mike. I’ll certainly look more into it.

    Hi Shane. I’m not quite so sure how I feel about it. The reason I wanted to give Expression Engine a shot was because I thought it was already capable of doing what I originally wanted—I didn’t know that I would need to buy additional components. I was really excited when seeing that I could create custom channel fields that are “searchable” and have the ability to specify things like if the field is an integer (which I would’ve assumed is for purposes like sorting).

    Thanks.

    Bryan

  • #7 / Oct 31, 2012 3:37pm

    Boyink!

    5011 posts

    The fields are searchable, but the more you move away from ‘find one value in one field at a time’ type search the less native functionality is going to satisfy you.

    Put another way, it’s not that you might necessarily *need* SuperSearch, but you’ll probably spend at least it’s equivalent costs in time trying to not use it.

  • #8 / Oct 31, 2012 9:20pm

    xdupChook

    9 posts

    I see. I’m assuming that since you recommended it, you’re at least a little familiar with Super Search.. would I be able to search if multiple fields contain a value?

    Also (within native EE), if I had a page list several entries, could I sort the entries by a custom field, such as one that contains only integers? Thinking about it a little more, I actually think that sorting is a more important feature than searching.

    Thanks.

    Bryan

  • #9 / Nov 01, 2012 10:13am

    Just to butt in here: Having a user sortable list is definitely possible with native EE. It’s explained here: http://ellislab.com/expressionengine/user-guide/modules/channel/dynamic_parameters.html

    Basically you create a form which interacts with the list in a very straightforward manner. I’m building something similar at the moment and for some more advanced filtering I might also have to resort to an add-on or the query module. But sorting by any field is natively supported, as well as simple filtering by category or custom field, through the channel entries tag with a few dynamic parameters.

  • #10 / Nov 01, 2012 12:07pm

    Shane Eckert

    7174 posts

    Hey there geertvdheide,

    Thanks for chiming in!

    How are things Bryan? Anything else we can do to help?

    Cheers,

  • #11 / Nov 02, 2012 12:05am

    xdupChook

    9 posts

    Thanks for the input Geert van der Heide! It definitely helps.

    Shane—things are getting much better, but not quite there yet.

    Though, I’m having a hard time understanding the difference between channel fields and categories. Could someone please explain this to me or point me in the right direction? I had a hard time following the documentation explaining it.

    Also, just to make sure I understand this correctly, channels are basically just groups that I place entries in and on pages, I can show a channel which shows has all the entries I put into it, right?

    Last, I found on the channel entries page ( http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html ) that you can filter by things such as author id’s.. is there a way to filter by custom channel fields? Such as only display videos that have custom field property A and custom field property B?

    Thanks.

    Bryan

  • #12 / Nov 02, 2012 9:34am

    Boyink!

    5011 posts

    Channels are storage containers for content.

    But they are useless on their own.  Well, almost. Each channel gets a handful of fields (title, url title, entry date etc) by default.

    Channel fields are the means by which you create the more usable structure within a channel. 

    Channel = a spreadsheet page or database table.

    Fields are the spreadsheet columns or database fields.

    Entries are the rows in the spreadsheet or the table.

    Categories are intended to be simple filters. By assigning a category to an entry there are tags to use to return all entries with that value assigned as categories.  Think of a weblog sidebar with “show posts from” and choices of my food, random thoughts, or company news. When you click a category the blog filters down to show just the entries with that category selected.

    It sounds like you are looking to build a more advanced site - I’d recommend building out a small basic site in EE just to get the hang of most of it’s functionality.

     

  • #13 / Nov 04, 2012 6:38pm

    xdupChook

    9 posts

    Ah, just as I suspected. I appreciate the spreadsheet analogy (I work in research and process spreadsheets quite frequently). Thanks Mike!

    I’m just about where I want to be, but I have one more question. I’m trying to combine dynamic parameters with the search channel entries tag.  I’ve tried several different approaches, including using the : to specify which field in several different locations, all without success. What would be the best way to do this?

    Thanks.

    <form method="post" action="{path='main/filteredResults'}">
     <select name="search:meat">
      <option value="beef">Beef</option>
      <option value="chicken">Chicken</option>
      <option value="pork">Pork</option>
     </select>
     <input type="submit" value="Go!" />
    </form>
    {exp:channel:entries channel="recipes" limit="2" dynamic_parameters="search:meat"}
     {body}
    {/exp:channel:entries}
  • #14 / Nov 04, 2012 6:46pm

    xdupChook

    9 posts

    Nevermind—I figured it out! Thanks everyone for your input and best of luck to you all.

    Bryan

  • #15 / Nov 06, 2012 12:01pm

    Shane Eckert

    7174 posts

    Hey Bryan,

    Glad to hear it!

    What great thread.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases