User Documentation

User:Entries template tag

The User:Entries tag mimics the Channel:Entries tag, but enables you to filter channel entries by User Related Authors member ID's.

{exp:user:entries} content {/exp:user:entries}

Parameters

Most of the parameters available in the Channel:Entries loop are available here. Additionally, these exist as well:

dynamic=

dynamic="no"

This parameter is available to stop the loop from looking into the URI for an ID of any type.

limit=

limit="15"

This parameter controls how many results will be outputted. The limit will default to 100 entries if a value is not specified.

orderby=

orderby="username|screen_name"

This parameter gives you the ability to control the order in which your users are ordered in the list. You can order by any variable that you can parse on as well as random.

paginate=

paginate="both"

Pagination works just like it does in the Channel:Entries tag. When specified, and used in conjunction with the user_paginate variable pair, pagination will display. Refer to Channel:Entries tag documentation for more information.

sort=

sort="asc"

You can sort by asc or desc.

user_author_id

user_author_id="{segment_3}"

This parameter allows you to hardcode an author ID or pull an author ID dynamically from the URL. To specify multiples, use the pipe character.

Variables

Most of the variables available in the Channel:Entries loop are available here.

Variable Pairs

The following variable pairs are available for use:

user_paginate

{user_paginate}
    <li>
        Page {user_current_page} of
        {user_total_pages} pages &nbsp;
        {user_pagination_links}
    </li>
{/user_paginate}

OR

{user_paginate}
<ul class="pagination">
    {user_pagination_links}
        {first_page}
            <li><a href="{pagination_url}">First</a></li>
        {/first_page}
        {previous_page}
            <li><a href="{pagination_url}">&laquo; Previous</a></li>
        {/previous_page}
        {page}
            <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
        {next_page}
            <li><a href="{pagination_url}">Next &raquo;</a></li>
        {/next_page}
        {last_page}
            <li><a href="{pagination_url}">Last</a></li>
        {/last_page}
    {/user_pagination_links}
</ul>
{/user_paginate}

Pagination is available for this tag and works just like regular EE pagination, but each variable/variable pair is prepended with user_ (except for any variables and variable pairs inside of the user_pagination_links variable pair). Used in conjunction with the paginate parameter.

Conditionals

The variables above are available as conditionals. Additionally, these exist as well:

user_no_results

{if user_no_results}
    Sorry, no results were found.
{/if}

This conditional displays its contents when there are no results.

Examples

Below is a basic example of how your User:Entries template might look. The example in using the scenario of having a member ID in the 3rd segment of the URL to pull dynamically:

<ul>
    {exp:user:entries
        channel="main"
        user_author_id="{segment_3}"
    }
        <li><a href="{url_title_path='news/article'}">{title}</a></li>
        {if user_no_results}
            <li>No results for this member.</li>
        {/if}
        {user_paginate}
        <ul class="pagination">
            {user_pagination_links}
                {first_page}
                    <li><a href="{pagination_url}">First</a></li>
                {/first_page}
                {previous_page}
                    <li><a href="{pagination_url}">&laquo; Previous</a></li>
                {/previous_page}
                {page}
                    <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
                {/page}
                {next_page}
                    <li><a href="{pagination_url}">Next &raquo;</a></li>
                {/next_page}
                {last_page}
                    <li><a href="{pagination_url}">Last</a></li>
                {/last_page}
            {/user_pagination_links}
        </ul>
        {/user_paginate}
    {/exp:user:entries}
<ul>

Support

Having problems setting up and/or using User? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.