1

We have a system of creating a client entry when someone registers for our site. We can add more information to the client entry from the Content > Edit forms. The problem I am having is limiting channel entry results by screen name. The title of every client entry is screen_name, but I am not able to narrow entry data by screen_name.

We also have Matrix fields so organizing those is difficult. Below is an example of the code I have been working with:

 {exp:channel:entries channel="clients" member_="CURRENT_USER"}
                                {client_project}<tr>
                                        <td>{title}</td>
                                        <td>{entry_date format="%m/%d/%y"}</td>
                                        <td><a href="/client/client_project/{entry_id}" class="view">View</a></td>
                                </tr>{/client_project}
                            {/exp:channel:entries}

This code produces no resutls. Also:

 {exp:channel:entries channel="clients" orderby="logged_in_screen_name" limit="1"}
                                {client_project}<tr>
                                        <td>{title}</td>
                                        <td>{entry_date format="%m/%d/%y"}</td>
                                        <td><a href="/client/client_project/{entry_id}" class="view">View</a></td>
                                </tr>{/client_project}
                            {/exp:channel:entries}

This returns a result, but not the correct one.

Thanks!

  • On your opening channel:entries tag member_ is not a valid parameter. Maybe it's a typo but thought I'd mention it. – Alex Kendrick Nov 22 '13 at 14:49
1

The code examples you posted will never work.

First, member_="" is not a parameter accepted by the exp:channel:entries tag.

Second, "logged_in_screen_name" is not a value accepted be the orderby="" parameter.

The EE docs detail all the usable parameters.


This will work:

{exp:channel:entries channel="clients" author_id="CURRENT_USER"}

This method requires that the author of the entry be set to the member who should have access to edit the entry. So when you create the entry, set them as the author.

In order to show a list of members in the author list you'll need to enable this setting for the specific member group: Include Members in PUBLISH page multi-author list?

After enabling the setting, go to your edit form in the CP and you will see the Author list. If you don't see the author list, you may need to edit your Publish Layout to make it visible.

| improve this answer | |
1

I did something which sounds fairly similar on an ExpressionEngine 1.x site a few years ago. The route that worked the best was to have the member as the author of that entry and then use the author_id parameter to only grab content authored by that entry.

The scope of that project was to display member created content (profile, examples of their work, etc) and so it might not apply in your case.

| improve this answer | |
1

If you don't want to limit by author_id (because that isn't the same as screen_name), I would try a solution that uses the search parameter: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#search-field-name

You might have to do something like this:

Have the template URL something like this: http://example.com/group/template/screen_name

then in the channel entries tag add the parameter like this: search:title="{segment_3}"

I would make a new channel field for your entries that records screen_name and make the titles unique.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.