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.

Show Entry ONLY if it has a comment from the current user?

June 13, 2011 8:42pm

Subscribe [3]
  • #1 / Jun 13, 2011 8:42pm

    pcm

    17 posts

    Is this possible? I’ve tried a lot of different things. I can get obviously show comments just from the current user, but I can’t get the initial results to filter in a way where an entry isn’t showed at all if there’s not a comment from the user.

    Anyone point me in the right direction? For the sake of an example, I’ll put what I have below, but I obviously need another layer at the exp:channel:entries level to filter the output before it even gets to showing the actual comments.

    {exp:channel:entries channel="channel1" disable="trackbacks|member_data|pagination" show_future_entries="yes" orderby="title" sort="asc" limit="8"}
                    
                        <h2>{title}</h2>
    <p>                    {exp:comment:entries entry_id="{entry_id}" comment_id="{comment_id}" sort="desc" orderby="date" limit="10" dynamic="yes" }<br />
                            <br />
                                {if logged_in_member_id == author_id}<br />
                                    {comment}<br />
                                {/if}<br />
                            <br />
                        {/exp:comment:entries}<br />
            {/exp:channel:entries}

    Moved to Community Help forum by Moderator

  • #2 / Jun 14, 2011 3:11pm

    John Henry Donovan

    12339 posts

    pcm,

    I wouldn’t suggest nesting your Comment Entries tag inside the Channel Entries tag like this. I would go the way of a Query to wrap it in to check if the logged in user has a comment for that entry and show then.

    I can move this thread to the Community Help forum for you where other members may be able to help you with that specific query?

  • #3 / Jun 14, 2011 3:39pm

    pcm

    17 posts

    That would be great. Thank you.

  • #4 / Jun 15, 2011 1:02pm

    Sue Crocker

    26054 posts

    Moving per request..

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

ExpressionEngine News!

#eecms, #events, #releases