Hi all.
I need to add an additional helper function to bench press to simplify the data preparation logic. I know what it looks like on the API benchpress side. I need to use the same set of client-side and server-side rendering support functions. I see NodeBB doing this - once a helper is defined, it is available to both.
Is there a dedicated place for a plugin somewhere to add such a feature visible to both the client and the server or is a bit more work required?
Johan Watherman
Posts
-
Custom helper function for benchpress -
Clean way to provide alias for linkOk, looks like I know what I need to know, what's possible, what doesn't make sense, and what could be a workaround.
Thank you very much. -
Clean way to provide alias for linkYes, I was thinking about this type of solution or something like this:
app.get('/my_name/:my_param', async (req, res, next) => { const cid = ... //some calls res.render("/category/"+cid"); });
And just do extra steps (add extra data) in filter:<template>.build hook.
If it is not possible now, thank you for the information, it saved me a lot of time searching for a workaround, doomed to failure.
Of course, it would be good to enable something like this in the future, but this is a second or even third category of importance from my point of view - I can always use an existing address in my case. It will be a little less fancy but still functional.EDIT:
I found not listed in hook auto-generated list hook response:router.page. Its looks like good but strange animal. I found it when I'm try to check filter:router.page - it is present in docs but is deprecated.['filter:router.page', { new: 'response:router.page', since: 'v1.15.3', until: 'v2.1.0', }],
-
Clean way to provide alias for linkHi.
I'm writing (still!) a big plugin. I need to use my own url for some categories, but for the sake of maintaining the plugins, I operate their rendering on the normal category view (I simply modify the template by adding a few ifs and adding additional data). This looks like the best way in terms of future updates and bug resistance (so as not to duplicate all the data that NodeBB normally provides for the view).
Getting to the point. I would like to use the address in the form /my_name/:my_param but render page from /category/:cid. I can just find myself mapping between my_param to cid, but I'm searching the best, clean way to do this.
Is this possible in NodeBB without hacking hacks?
The best solution would be to simply call the function with the new URL in some hook, but I understand that it may not be that simple. -
Best way to store plugin data in database in context of compatibilityHi all.
My plugin, apart from the general configuration that can be stored in a typical mechanism created for this purpose, needs to save certain data to the database during its operation.Explaining.
I have a collection of objects, let's call them X. Each object X has several related topics and users (the data from them needs to be rendered in the profile). In addition, each X object is associated with a specific number of sections on the forum.
The number of X objects is unlimited, they can be created as a result of user actions.I have a few questions.
- Do I understand correctly that I should simply save the collection of X objects like any other data in NodeBB, using its abstract data access mechanisms?
- Can I expand the user data, topic, posts, etc. with an additional field in the database (probably containing the id of related X objects so that I can immediately ask about the right objects)?
My question is mainly aimed at the compatibility of the database and engine version, can such exact data spoil things when updating (assuming, of course, no name collision)?
-
PostgreSQL support?Hi all.
I find in documentation that NodeBB using MongoDB or Redis. Ok, im fine with this. However, I also found support in the sources support for PostgreSQL.What is the status of PostgreSQL support on NodeBB? Full? Future? Legacy?
-
Overwriting the composer template by theme if it comes from a pluginThanks. I was in this tab many times during development and I began to subconsciously ignore this big button.
-
Overwriting the composer template by theme if it comes from a pluginThank you. Is there any way to force the order in which plugins are loaded? Because from what I understand it looks like this:
- Loading the base nodebb templates
- Loading my own theme
- Loading plugin templates
So if I just want to overwrite nodebb-plugin-composer-default
I need to have a guarantee that my plugin (let's call it nodebb-plugin-composer-default-overwrite) will always be loaded after it. -
Overwriting the composer template by theme if it comes from a pluginHi.
I'm using https://github.com/NodeBB/nodebb-plugin-composer-default plugin to provide nice composer for my forum. I need do some customization in this area but I won't fork this plugin due to ease of maintenance.
I tried adding compose.tpl and composer.tpl files to my theme with slight changes.
This didn't work as expected, composer still uses its own tpl files.
Is there an elegant way to overwrite these files with a theme/another plugin or am I making a mistake somewhere (the order in which the plugin are loaded or something I haven't thought about)? -
Child theme from Harmony theme - build problem@baris thank you for your reply. In fact, I just had to copy the whole overrides.scss from harmony theme. It didn't even cross my mind that overrides won't come from base theme as second overrides but maybe its lack of my knowledge about sass.
Thank you. -
Child theme from Harmony theme - build problemHi all.
I am writing in this section because the theme section generally contains a list of them, and themes are, however, some kind of plugin. If I am wrong, please in advance to move the topic.I started to create my own derivative theme (using the child theme mechanism) based on Harmony. Nodebb v3.2.3. I used this https://github.com/nodebb/nodebb-theme-quickstart to start. I need to fix some issiues like change theme.less to css and write "baseTheme": "nodebb-theme-harmony" in my theme.json.
Unfortunately, I can't build styles for the theme. I see following problem:
2023-08-29T17:38:32.459Z [4567/9443] - info: [build] client js bundle build completed in 0.611sec Error: Error: Undefined variable. ╷ 29 │ font-family: $font-family-secondary; │ ^^^^^^^^^^^^^^^^^^^^^^ ╵ ../../node_modules/nodebb-theme-harmony/scss/common.scss 29:15 @import ../../node_modules/nodebb-theme-harmony/scss/harmony.scss 3:9 @import ../../node_modules/nodebb-theme-harmony/theme.scss 1:9 @import theme.scss 1:9 @import - 49:9 root stylesheet
My brief research into the problem led me to the issue of fontsource - inter and poppins. I see that NodeBB import this packages itself but Harmony theme do it redundant and put both of them in static dir in plugin.json:
"staticDirs": { "inter": "node_modules/@fontsource/inter/files", "poppins": "node_modules/@fontsource/poppins/files" },
I tried a bit of a blind solution to this by adding similar snippets or as modules for the above modules but it was a pretty random attempt.
If anyone can help me out by pointing out what else I should do, I'd appreciate it. Additional explanation of what exactly is required here and why it doesn't work "out of the box" is also welcome, I have some customization work to do - it will save me a lot of debugging the engine to understand the nuances of plugins system.