XF 2.1 Template modifications condition error

SkinsForum

Member
hi i'm writing add-on for sub forum icons how do I make the template change?

this did not happen

Code:
    &.subNodeLink--forum:before,
    &.subNodeLink--category:before
    {
        .m-faContent( {{$xf.options.sF_SubForumManager_unreadSubforumIcon ? @fa-var-comments}} );
    }

err.webp
 
That template syntax is invalid anyway, but I'd probably change it to this:
Less:
.m-faContent(xf-default(xf-option('sF_SubForumManager_unreadSubforumIcon'), @fa-var-comments));
 
FWIW, your original version wasn't far away. You would either do this:
Less:
.m-faContent( {{$xf.options.sF_SubForumManager_unreadSubforumIcon ? $xf.options.sF_SubForumManager_unreadSubforumIcon : @fa-var-comments}} );
Or a shorter version is this:
Less:
.m-faContent( {{$xf.options.sF_SubForumManager_unreadSubforumIcon ?: @fa-var-comments}} );
Our preferred approach is to use the Less specific functions though.
 
FWIW, your original version wasn't far away. You would either do this:
Less:
.m-faContent( {{$xf.options.sF_SubForumManager_unreadSubforumIcon ? $xf.options.sF_SubForumManager_unreadSubforumIcon : @fa-var-comments}} );
Or a shorter version is this:
Less:
.m-faContent( {{$xf.options.sF_SubForumManager_unreadSubforumIcon ?: @fa-var-comments}} );
Our preferred approach is to use the Less specific functions though.
thank you so much
 
Top Bottom