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

XF 1.3 Message Template Conditional based on Prefix

Discussion in 'Styling and Customization Questions' started by tonnyz, Jan 13, 2015.

  1. tonnyz

    tonnyz Member

    I'm styling my message template based on the prefix of the thread.

    How should I do this ?

    thx :)
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can use $thread.prefix_id in xen:if to apply new classes, HTML, etc.
  3. tonnyz

    tonnyz Member

    I tried this without any result
    <li id="{$messageId}" class="{xen:if '{$thread.prefix_id} == 2', 'prefixStyle'} message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_staff}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
    What might be wrong ?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I assumed you meant the thread_view template.

    I doubt that is available in the message template.
  5. tonnyz

    tonnyz Member

    How should I list all the variable availables in a template.

    I found JakeBunce's resource, but I think it only lists the content of a variable (i.e. $thread contents are: thread_id, node_id, etc)
    but not the variable itself (i.e. thread_view contents are: $thread, $forum, etc)

    I'm searching the latter.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    tonnyz likes this.
  7. tonnyz

    tonnyz Member

  8. tonnyz

    tonnyz Member


    Is $thread.prefix_id can be used inside PAGE_CONTAINER template ?

    If it can't , can I style .forum_view .titleBar based on the prefix without developing any custom add-on ?

    thx :)
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure what it is you're trying to do.

    The forum view title bar is a forum level element, not thread level, so a thread prefix wouldn't apply there.
    tonnyz likes this.

Share This Page