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 class="col-md-1 hidden-sm hidden-xs stats">
    			<span class="human-readable-number" title="{topics.postcount}">{topics.postcount}</span><br />

    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

  • 3 Votes
    21 Posts

    I got reindexing working mostly fine, with a live progress bar and actually in the background. So v0.5 should have everything this plugin needs now.

    I'll still look into a possibly better frontend integration with their libraries, but I'd probably need to replace the existing NodeBB search preview. There is also a bit more sorting/filtering I want to pass to Meilisearch instead of leaving it to NodeBB later, but that's not a big deal.

    I'm also considering if some LRU cache for recent searches is needed, but I'll have to test performance on a larger instance than my tiny tests 🙂 I'll probably end up adding one with low TTL though.

    So since it's close to release-ready I created a topic for it:

  • 0 Votes
    1 Posts

    As mentioned in the title, I want to add some javascripts and html to my post. For example, I want to show data by calling api in a specific post.

    I tried the plugin -> markdown ->Allow HTML, it does not work.It seems will ban the javascript.

    So is there any good way to meet my needs?
    Thanks s lot.


  • 0 Votes
    17 Posts

    Hi there. Im usualy not very active on forums or other things similar to forums. But just to make an example of a good business model for devs:

    From a marketing experts point of view:

    Make a plugin/theme everyone likes (Advertising) Make the plugin/theme free (Advertising) Tell them you can make plugins/themes for money (Advertising) Take jobs, make money (Income)

    As for a marketplace:

    make everything what is in the marketplace free pictures and descriptions of every plugin/theme Links to devs/contacts where you can order a personalized theme/plugin
  • 0 Votes
    5 Posts

    There was someone around here who successfully managed to install on OpenShift about a week or two ago, I'm waiting patiently for the guide as well 😛

  • Clear Template Cache?

    General Discussion
    0 Votes
    3 Posts

    @julian That was it.

    I had an older version of the Lavender theme with the old style admin template.