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.

Use custom field in stead of status?

May 11, 2011 7:55am

Subscribe [8]
  • #1 / May 11, 2011 7:55am

    rubberglover

    11 posts

    I have a channel with a radio button, which I can use to define the post as either an ‘On Test’ or ‘Product roundup’ post.

    I want to show the latest entry that has been set to ‘On Test’. This would be easy using custom statuses, but using the status field to select the post type in this instance is not that intuitive for the client.

    What is the least server intensive way of using the radio button custom field as a filter when extracting the results?

  • #2 / May 11, 2011 9:45am

    Mark Bowen

    12637 posts

    If you change to using a drop-down field instead then you could use the search://body=”“ Channel Tag parameter. I don’t believe that it works with radio buttons although I suppose it wouldn’t hurt to test it out as I have heard that it has worked with other field types that aren’t mentioned as being supported in the documentation before now.

    If that doesn’t work then you would probably be looking at creating your own custom SQL query.

    Hope that helps a bit.

    Best wishes,

    Mark

  • #3 / May 11, 2011 11:14am

    rubberglover

    11 posts

    Well what do you know?! That works a treat with the radio buttons!

    Is there any reason that these sneaky supported fields are not listed in the documentation? My only concern is that if the field type is not officially supported by the search:my_field=’’ tag then it might stop working on a future EE update? Unlikely admittedly, as that would probably only happen if the upgrade introduced an adjustment to the sql table layout? But hey, just food for though… I’ll stick with this for now, but it would be great if this and any other field types that it seems to support are recognised and supported officially (and listed in the documentation!).

    Many thanks for the tip!

  • #4 / May 11, 2011 11:16am

    Boyink!

    5011 posts

    I’ve found in the past that if I posted a comment in the documentation those comments were sometimes incorporated into the docs.

  • #5 / May 11, 2011 11:20am

    Mark Bowen

    12637 posts

    To tell the truth I’m not certain why the documentation doesn’t list them as being compatible. Might just be that the documentation needs updating however it would be nice to hear back from one of the moderators as to whether this is a good thing to be doing or not.

    I ‘believe’ that you shouldn’t have any problems in the future but can’t attest fully to that so hopefully a moderator will come in and let us know the full answer to that.

    Best wishes,

    Mark

  • #6 / May 11, 2011 2:04pm

    JohnGribben

    111 posts

    Apparently the search:my_field=’’ parameter doesn’t work with checkboxes. I’m also trying to filter entries by a custom field, but I’m using checkboxes, and it’s not working.

  • #7 / May 11, 2011 5:15pm

    Kevin Smith

    4784 posts

    Hey everyone! Good discussion. I’m not sure the ins and outs concerning the channel entries search parameter, so I’ll going to send this one up to the developers and see if we can all get a clearer answer. Hang tight.

    Kevin

  • #8 / May 11, 2011 6:47pm

    Mark Bowen

    12637 posts

    Thanks Kevin,

    Looking forward to what comes out of this one.

    Hopefully it’s just a documentation update needed.

    Best wishes,

    Mark

  • #9 / May 12, 2011 6:12pm

    Brandon Jones

    5500 posts

    Hi all

    Radios should be safe and I wouldn’t fear using them. Checkboxes are going to be unpredictable I think, due to how the data is stored currently.

  • #10 / May 14, 2011 12:33pm

    boldyellow

    89 posts

    If you change to using a drop-down field instead then you could use the search://body=”“ Channel Tag parameter.

    Evidently not third-party drop-downs however. I’m using a Member List Custom Field which apparently is a separate fieldtype, although it is a drop-down. 

    It appears my options are (and by the way, I’m all ears to suggestions and ideas here):

    1. Use a different method to display my member list in an EE drop-down field that works with search:body=”“.

    2. Or get this third-party drop-down to play nice with search:body=”“.

    Back story 1: it’s a client review area for a producer… so members (his clients) are created by the admin in EE. Then clients login to a page specific to their productions that is output from a “client approval” channel.

    Back story 2:  After alot of training, tutorials (thanks Mike!) and general fiddling around, this is my first full-blown EE site… so there could be a gap in my thinking on this.

  • #11 / May 14, 2011 2:28pm

    Mark Bowen

    12637 posts

    If you change to using a drop-down field instead then you could use the search://body=”“ Channel Tag parameter.

    Evidently not third-party drop-downs however. I’m using a Member List Custom Field which apparently is a separate fieldtype, although it is a drop-down.

    Sorry I had meant to say that I was referring to the built-in drop-down fields above.

  • #12 / May 14, 2011 3:56pm

    Greg Salt

    3988 posts

    Hi boldyellow,

    Yes, as Mark has said, 3rd party fieldtypes are different since the developers have a multitude of ways to store their fieldtype data and in your particular example above it’s likely (though not certain since I’ve never used that addon) that the only things stored are the member IDs and not the names and also likely in a different format to the way that a 1st party field might store similar data. You may have to use the Query Module to replicate the functions of the Channel tag and also account for any client specific name or ID in the URL of the area they login to. Alternatively, if the client accounts have to be created manually anyway (and their data is channel based) then you might consider assigning each client as the author of their applicable entries and then you can use standard Channel tags to show them only ‘their’ data using the CURRENT_USER constant with the author_id parameter.

    Cheers

    Greg

  • #13 / May 14, 2011 4:42pm

    boldyellow

    89 posts

    Two good suggestions… I was already researching the Query angle, but the Author idea sounds intriguing… I will check out both, thanks for the assist!

  • #14 / May 14, 2011 4:45pm

    Greg Salt

    3988 posts

    Hi boldyellow,

    Okay, good stuff.

    @John and rubberglove, are you guys all set?

    Cheers

    Greg

  • #15 / May 16, 2011 9:37am

    JohnGribben

    111 posts

    I’m good. Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases