Help needed by searching some variable in template.

General Discussion
  • 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.

  • 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.


Suggested Topics