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

$category.hasNew not working?

Discussion in 'XenForo Development Discussions' started by Euthyphro, Jul 26, 2011.

  1. Euthyphro

    Euthyphro Member

    Hey guys/girls,

    Basically I'm adding a custom template page, but what I'm trying to do is use the hasNew template function.

    From what I've seen in other templates, it is usually used with $category.hasNew or $forum.hasNew. Taking cue from this, I guessed that $category could be the category id of any forum category, and using the hasNew function I would get a true/false return on whether a forum category had any new posts.

    So I implemented the following code, although a bit unorthodox in the way of xenforo, I'm just making a quick fix for now:

    <xen:set var="$mc_cat">3</xen:set>
    <xen:set var="$os_cat">23</xen:set>
    <img id="show_Minecraft" src="mc_icon{xen:if $mc_cat.hasNew, '_new'}.png" />
    <img id="show_AuroraSim" src="os_icon{xen:if $os_cat.hasNew, '_new'}.png" />
    Nonetheless, when ever I use this, the condition constantly returns true and as a consequence, the '_new' as you can see above. The problem is that I only want the '_new' to be added when there are new posts.

    Any suggestions?


Share This Page