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.

No Results Tweaks

August 31, 2011 6:07am

Subscribe [3]
  • #1 / Aug 31, 2011 6:07am

    Fruit Studios

    20 posts

    Hi There,

    I’m using the ‘CKI Member List’ fieldtype to display only results for a specific member. As results can be returned, even if they might not be displayed, I need to display no results code for when no entries are found for a specific member, has anyone go any thoughts on how to achieve this?

    {exp:channel:entries channel="technical_documents" dynamic="no"}
    
        {if logged_in_member_id == "{cki_member_list_field get="member_id"}"}
            
            {!-- Show Entry --}
            
            {title}
                                            
        {/if}
    
    
        {if no_results}
        
            {!-- Show No Results When 0 Entries Returned --}
            
            No Results 
        
        {/if}
    
    {/exp:channel:entries}

    Many thanks,

    Sam

    Moved to Community Help forum by Moderator

  • #2 / Aug 31, 2011 8:06am

    Dave @ Exp:resso

    465 posts

    I’m not familiar with that particular fieldtype (and couldn’t find it on devotee) but surely you can just add an ‘else’ conditional. Like this:

    {if logged_in_member_id == "{cki_member_list_field get="member_id"}"}
            
            {!-- Show Entry --}
            
            {title}
    
        {if:else}
            No results                                
        {/if}
  • #3 / Aug 31, 2011 9:00am

    Fruit Studios

    20 posts

    Unfortunately that wont work for me as there can be multiple entries per each member, and for each entry that doesn’t match the logged in member it will output the no results code, and it could therefore be outputted more that once.

    With PHP I would set a variable when an entry was found and then use a conditional to determine whether the no results code needs to be displayed. I just cant seem to achive this with a channel:entries tag??

    Many thanks,

    Sam

    PS. Just downloaded the latest release of Freemember plugin that you guys delevloped, absolutely fantastic, works a dream and so well documented, cant wait to get stuck into your other plugins!

  • #4 / Aug 31, 2011 9:11am

    Fruit Studios

    20 posts

    Forgot to say: Member list custom field:

    http://devot-ee.com/add-ons/member-list-custom-field

  • #5 / Aug 31, 2011 9:24am

    Sue Crocker

    26054 posts

    Thanks for the assist, Dave.

    Sam, since this question has to do with a third party add-on, moving this thread to the Community Help forum for additional community support.

  • #6 / Aug 31, 2011 9:28am

    Fruit Studios

    20 posts

    Hi Sue, Ok, im not sure that the 3rd party add on bit is really the key to the query, its more to do with EE, the if conditional could just as well refernce a standard ee custom field, with an id in it??
    Sam

  • #7 / Aug 31, 2011 10:21am

    Dave @ Exp:resso

    465 posts

    Thanks for the feedback about freemember - theres so much more we have planned but theres just not enough hours in the day at the moment.

    Ah I see what you mean now. One entry can only be linked to one member right? So can’t link it to a member using the built-in author field? Then use a channel entries loop to pull all the entries by that author. (The author being the currently logged in user on the frontend). That would give you more flexibility to add limits/order_by etc. Another option (and I hate always having to recommend this) is solspace user, it comes with some functions to make this easier.

  • #8 / Aug 31, 2011 12:53pm

    Fruit Studios

    20 posts

    I know how you feel but if there were more hours we would just make more work to fill them! No going to complain about being busy though!

    I had thought about using the author field. Its not ideal as our client will be using the cp and I want it to be a clear as possible but I cant seem to get the permissions set up to allow it any how. I have updated the Staff (user) member group to allow ‘Can change the author name when posting channel entries’ but it doesnt want to play, am i missing some other config anywhere?

    Many thanks,

    Sam

  • #9 / Aug 31, 2011 6:58pm

    Dave @ Exp:resso

    465 posts

    Well have a carefull look through the member group permissions to see if theres anything else that could relate to it. Also make sure the field is showing, to staff, on your publish page layout. You need to save a layout for the staff group

  • #10 / Aug 31, 2011 9:43pm

    Fruit Studios

    20 posts

    I’ve checked through all the settings and setup the publish layouts but i just cant seem to get it working smoothly, sometimes members sometimes they don’t. I need to attach entries to members of a group called clients, which is confusing things further.

    Trying to think of a workaround I could use within the entries tags, would a custom query be able to achive this, I have not really used them before??

    Thanks

  • #11 / Sep 01, 2011 7:01am

    Dave @ Exp:resso

    465 posts

    Well selecting the authors should work. If not, then its either a bug or you’re doing something wrong. Looks like your options are to either troubleshoot that, or buy the solspace user module. I hate having to recommend an expensive 3rd party module for functionality that should be standard, but it just comes down to how much your time is worth.

  • #12 / Sep 01, 2011 7:20am

    Fruit Studios

    20 posts

    Thanks for all your feedback, I will try and work out what im doing wrong, but I might have to resort to user! Going to be trying out your Store Add-on soon, looks awesome! Sam

  • #13 / Sep 01, 2011 7:23am

    Dave @ Exp:resso

    465 posts

    No problem, just post again if you have any other questions! The way I look at it - your time has to be worth at least $50 per hour, so if it saves you 2 hours of faffing around, its worth just getting User.

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

ExpressionEngine News!

#eecms, #events, #releases