Skip to content

How to make Category Sections?

NodeBB Development

Suggested Topics


  • A light re-shuffling of categories...

    NodeBB Development
    2
    3 Votes
    2 Posts
    300 Views
    omegaO
    It has certainly improves the first impression of categories page.
  • how to organise categories into seperate lists?

    NodeBB Development
    1
    0 Votes
    1 Posts
    304 Views
    S
    every under section, i want to store every category in a seperate <ul/> list This is what i currently have, and there are 2 problems: all content disappears from the categories, and a bunch more appear for some reason (no clue why this is happening: https://i.imgur.com/pNIGH2v.png) not sure how to repeat this loop until section category is reached (forgive my poor logical thinking :D) categories.tpl: (nodebb-theme-oxide) https://i.imgur.com/Hqyu3zm.png https://i.imgur.com/MLpqvY1.png https://i.imgur.com/Nw6DHyk.png
  • Users to whom the category is available

    NodeBB Development
    7
    0 Votes
    7 Posts
    901 Views
    M
    As a result, I got such a script, maybe it will be useful to someone. const Theme = {} const user = require.main.require('./src/user') const privileges = require.main.require('./src/privileges') Theme.getUsersByCategory = async function(data) { const { templateData: { cid } } = data const allUserIds = await user.getUidsFromSet('users:joindate', 0, -1) const asyncFilter = async (arr, predicate) => { const results = await Promise.all(arr.map(predicate)) return arr.filter((element, index) => results[index]) } const availableUserIds = await asyncFilter(allUserIds, async (id) => { return await privileges.categories.can('read', cid, id) }) data.templateData.availableUsers = await user.getUsersData(availableUserIds) return data } module.exports = Theme
  • Creating separate categories

    Moved NodeBB Development
    7
    0 Votes
    7 Posts
    1k Views
    brian4021B
    Ahh okay. It did work the way I wanted to, once again thanks for the help @yariplus
  • Category Permissions

    NodeBB Development
    1
    0 Votes
    1 Posts
    875 Views
    ShardS
    I'm working on a plugin that programmatically adds group and/or user perms to a dynamically created category. I mimicked the call used in the write API, but I'm not sure I'm constructing the perms correctly - and that still doesn't answer the issue of single user perms for a category.

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