User Documentation

User:Roles_Entries template tag

The User:Roles_Entries tag mimics the Channel:Entries tag, but enables you to filter channel entries by entries that use the User Roles fieldtype. Using this tag, entries that do not have a User Roles fieldtype or any permissions there in, will not be shown.

{exp:user:roles_entries} content {/exp:user:roles_entries}


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



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



This parameter differs from the normal Channel:Entries entry_id="" paramater in that it will make a pre-defined list of entries for Roles Entries to filter from. If the entry ID's in this parameter do not have roles that match the restrictions lined out on the other parameters on this tag, the entries will not show. This is solely for a further level of filtering entries.



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



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.



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



This parameter allows you to manually specify roles to restrict entries to (by default all roles will be shown, if not specified). If using multiple roles, separate with the pipe character. This does not take into account the current user's available roles - only the roles listed in this parameter. If you wish for entries to only show to users that have matching roles assigned to them, see the restrict_to_user_roles parameter.

Role names must match the short name as defined in the User control panel. When specifying role names, this is NOT inclusive. It will only check to see if any of the roles specified in this parameter match any of the roles assigned to entries, no matter how complex they may be, or how many lesser or extra roles they contain from what it specified here.



This parameter allows you to specify that the logged in user's available roles will be used to filter entries that have been assigned some or all of the same roles the user has. Default is no. When using in conjunction with the restrict_to_roles parameter, it will check to see if the logged in user fully matches any of the sets of roles for each entry. So for example, if Entry X has the roles Monkeys AND Pants Wearers, OR Honey Dippers, but the user's assigned roles are Monkeys and Bench Warmers, they will not see Entry X because they don't have both Monkeys AND Pants Wearers roles assigned to them. They would need to also have the Pants Wearers role assigned to them.



You can sort by asc or desc.


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

Variable Pairs

The following variable pairs are available for use:


        Page {current_page} of
        {total_pages} pages &nbsp;


<ul class="pagination">
            <li><a href="{pagination_url}">First</a></li>
            <li><a href="{pagination_url}">&laquo; Previous</a></li>
            <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
            <li><a href="{pagination_url}">Next &raquo;</a></li>
            <li><a href="{pagination_url}">Last</a></li>

Pagination is available for this tag and works just like regular EE pagination. Used in conjunction with the paginate parameter.


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


{if user_no_results}
    Sorry, no results were found.

This conditional displays its contents when there are no results.


Below is a basic example of how your User:Roles_Entries template might look.

    <li><a href="{url_title_path='comments'}">{title}</a></li>
    {if user_no_results}
        <li>No results were found.</li>


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