Help needed by searching some variable in template.



  • Template file stored here /nodebb/node_modules/nodebb-theme-persona/templates/partials/topics_list.tpl

    And I want to find in this place

    		<div class="mobile-stat col-xs-2 visible-xs text-right">
    			<span class="human-readable-number">{topics.postcount}</span> <a href="{config.relative_path}/topic/{topics.slug}/{topics.teaser.index}"><i class="fa fa-arrow-circle-right"></i></a>
    		</div>
    
    		<div class="col-md-1 hidden-sm hidden-xs stats">
    			<span class="human-readable-number" title="{topics.postcount}">{topics.postcount}</span><br />
    			<small>[[global:posts]]</small>
    		</div>
    
    

    variable called {topics.postcount} - I just want to decrease it by one, but I can`t find its generating in controllers or middleware. thanks in advise.


  • Admin

    That partial is on all pages that display a list of topics ie /recent /unread /popular and /category pages. You need to create a plugin and add hooks for those pages the hook format is filter:<template_name>.build in those hooks you need to go through the topics array and subtract one from each topic's postcount.


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.