@pitaj Sure, why not:)
In the path /to_your_nodebb_path/node_modules/nodebb-theme-persona/library.js (or whatever file and path you want to add), after the first line which is 'use strict';, add these lines below the first line:
const helpers = require.main.require('./src/controllers/helpers');
const categories = require.main.require('./src/categories');
const meta = require.main.require('./src/meta');
const relative_path = require.main.require('nconf').get('relative_path');
helpers.buildCategoryBreadcrumbs = async function (cid) {
const breadcrumbs = [];
while (parseInt(cid, 10)) {
/* eslint-disable no-await-in-loop */
const data = await categories.getCategoryFields(cid, ['name', 'slug', 'parentCid', 'disabled', 'isSection']);
if (!data.disabled) {
breadcrumbs.unshift({
text: String(data.name),
url: `${relative_path}/category/${data.slug}`,
cid: cid,
});
}
cid = data.parentCid;
}
if (meta.config.homePageRoute && meta.config.homePageRoute !== 'categories') {
breadcrumbs.unshift({
text: '[[global:header.categories]]',
url: `${relative_path}/categories`,
});
}
breadcrumbs.unshift({
text: '[[global:home]]',
url: `${relative_path}/`,
});
return breadcrumbs;
};
Then comment out line starting with var meta by adding two //:
//var meta = require.main.require('./src/meta');
Then you can restart by either of these ways:
/nodebb_path/nodebb restart
service nodebb restart
systemctl restart nodebb
Regarding custom plugin, I'll consider it soon.