1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Trailing Comma on Conversation List

Discussion in 'Styling and Customization Questions' started by Amaury, Nov 7, 2014.

  1. Amaury

    Amaury Well-Known Member

    Our awesome coder @mike406 has finished revamping the following pages:
    • Discussion list
    • New Posts
    • Unread Watched Threads
    • All Watched Threads
    • Conversation list

    However, we've hit a small problem on the conversation list:


    The problem isn't shown here, but if we remove the date / time stamp, we get a trailing comma (e.g., Amaury, Mike, Nights, Sean, instead of Amaury, Mike, Nights, Sean).

    Here's part of our conversation on Skype, where Mike explained it:

    Is there any way to work around this and remove the trailing comma?
  2. Amaury

    Amaury Well-Known Member

    Still looking for some feedback. Any will be appreciated. :)
  3. Syndol

    Syndol Guest

    If you want to remove the date and last comma of the user names then apply the following template modification to conversation_list_item :
    <xen:foreach loop="$conversation.recipientNames" value="$recipient">
        <xen:if is="{$recipient.user_id} != {$conversation.user_id}"><xen:username user="$recipient">{xen:if $recipient.user_id, $recipient.username, {xen:phrase unknown_member}}</xen:username>,</xen:if>
    <a href="{xen:link conversations, $conversation}" class="faint"><xen:datetime time="$conversation.start_date" /></a>
    <xen:foreach loop="$conversation.recipientNames" value="$recipient" i="$i">
        <xen:if is="{$recipient.user_id} != {$conversation.user_id}"><xen:username user="$recipient">{xen:if $recipient.user_id, $recipient.username, {xen:phrase unknown_member}}</xen:username>{xen:if '{$i} < {$conversation.recipient_count} - 1', ','}</xen:if>
    Amaury likes this.
  4. Amaury

    Amaury Well-Known Member

    Just to make sure we're on the same page, do you mean template modification literally or template modification as in a template edit? I'm just asking because I was told by @Chris D a while ago that template modifications are really more for developers and add-on developers.
  5. Chris D

    Chris D XenForo Developer Staff Member

    That is true, really.

    The same instructions work, though, if you manually edit the template which is recommended.
    Amaury likes this.
  6. Amaury

    Amaury Well-Known Member

    Sure did work! Thanks, Chris and @Syndol!

Share This Page