Friends 1.x

Legacy documentation for Friends 1.x.

The Friends:Message_Folder_Name loop is a simple function that determines the Message Folder name of the folder being currently viewed. This would typically be placed in the Friends:Messages template. It looks for folder followed by the folder ID in the URI to determine which folder you're viewing.

{exp:friends:message_folder_name} content {/exp:friends:message_folder_name}

Parameters

The following parameters are available for use:

message_folder_id=

message_folder_id="{segment_3}"

The Friends:Message_Folder_Name loop will automatically grab the folder ID or name from the URI if you have it prepended by folder in the URI, but this parameter is available to use, should you be doing something more advanced.

Variables

The following variables are available for use:

friends_message_folder_name

{friends_message_folder_name}

This variable displays the name of the folder currently being viewed.

Examples

The following code shows how this loop might look like in your template, assuming you have the correct URL structure in place: http://www.yoursite.com/friends/messages/folder/FOLDER_ID/

<h3>
    Your Messages:
    {if segment_2 == ""}
        Inbox
    {if:else}
        {exp:friends:message_folder_name}
            {friends_message_folder_name}
        {/exp:friends:message_folder_name}
    {/if}
</h3>

<ul>
{exp:friends:messages
    message_folder="inbox"
}
    <li>
        <a href="{path='friends/message_view'}/{friends_message_id}">
            {friends_message_subject}
        </a>
        from
        {friends_message_sender}
            {friends_message_sender_screen_name}
        {/friends_message_sender}
        on
        {friends_message_date format="%F %j, %Y at %g:%i %a"}
        {if friends_message_read == "y"}
            (read on {friends_message_time_read format="%F %j, %Y"})
        {if:else}
            (unread)
        {/if}
    </li>

    {if friends_no_results}
        <li>You currently have no messages for this folder.</li>
    {/if}
{/exp:friends:messages}
</ul>