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

XF 1.4 Extending StatusIcons

Discussion in 'Styling and Customization Questions' started by big-k, Apr 20, 2015.

  1. big-k

    big-k Member

    Hi,

    I'm creating a new XF forum to replace my current VB and will eventually port over. One thing I like in VB is the use of icons to indicate various status of the thread in question. So I would like to replace the first avatar with an Icon that depicts unread, thread with replies, hot threads, new threads, closed thread, thread with user posts, etc.

    SO far, I've been only able to display unread/read with the following syntax. Question is
    1) How do I extend this syntax to accommodate the above conditions?
    2) Where do I find a full list of all conditionals?

    <xen:if is="{$thread.isNew}">
    <img src="path/to/unread/icon" />
    <xen:else />
    <img src="path/to/read/icon" />
    </xen:if>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If you want to see which params are available, add this to the thread_view template:
    Code:
    {xen:helper dump, $thread}
    The same approach can be used for any template and available params.
     
  3. big-k

    big-k Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    Add that code exactly as shown to the thread_list_item template.

    Then refresh the forum.
     
  5. big-k

    big-k Member

    Hi Brogan,

    Here's what I was trying to get to. WHats wrong with this syntax?

    <xen:if is="{$thread.isNew}"><img src="new.png">
    <xen:elseif is="!{$thread.discussion_open}"><img src="Closed.png">
    <xen:elseif is="{$thread.reply_count} > 100"><img src="HOT.png">
    <xen:elseif is="{$thread.user_post_count}"><img src="mini-me.png">
    <xen:else /><img src="old.png">
    </xen:if>
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You haven't closed the xen:elseif with a /.

    Code:
    <xen:elseif is="{$something}" />
     
    big-k likes this.
  7. big-k

    big-k Member

    PURRFECT. Take a look at my take on forum arrangement here. still work in progress ...
     

Share This Page