[nodebb-plugin-ns-custom-fields] NS Custom Fields
-
@Nicolas Is it possible to move the profile fields well into a new partial template? That way, you'd only have to do
<!-- IMPORT partials/profile-fields.tpl
, which is a little more handy. -
It could work.
Now, if we talk about Account View. It's just single JS, without template, and client JS is aware of Vanilla Theme. And to inject this JS only on Account page, I'm swapping profile.tpl, so you don't need edit it manually.
Main problem is lack of information from devs
-
Version 1.2.0
New version is available. It's a big update. Main feature: field types were introduced. Now you can create Select or basic Input. Selects are good for predefined options. ACP is also updated to handle
Select
creation and providing sufficient UX.Simplified edit process for themes.
Look and Feel of updated and new components
Field creator
Fields overview
-
In future every plugin will be multi-language.
For now, It's easier to change things when there is no language files. -
@Nicolas said:
@psychobunny Also I'm going to create another plugin, and I need this space in user's profile. Do you have any suggestions how I can reach it without manual editing also?
Sorry I missed this. We should add more hooks (or widget areas) in the profile section. This is way better than requiring people to edit the template for sure. If you make a PR to add that functionality I'm sure we would accept it
-
I think a hook would be better because all themes should use profile fields, but not all define widget areas the same. At the same time, a widget area in the profile area would be nice.
-
@psychobunny said:
@Nicolas said:
@psychobunny Also I'm going to create another plugin, and I need this space in user's profile. Do you have any suggestions how I can reach it without manual editing also?
Sorry I missed this. We should add more hooks (or widget areas) in the profile section. This is way better than requiring people to edit the template for sure. If you make a PR to add that functionality I'm sure we would accept it
How about giving plugins a way to specify some markup that'd added before/after every partial?
i.e. nodebb-theme-persona/templates/partials/topic/post.tpl existing would add a hooks/widget areas/whatevs. likebefore:topic-post
andafter:topic-post
? -
hi! sorry to bump this post. do you have any idea how I could get this running smoothly on 0.6.0? the plugin itself runs fine, and I can set up custom fields in the ACP, but when I try to import the partial (or even copy the contents of it into the .tpl itself), nothing shows. any idea why/how I can fix this?
(i can't update because the theme i'm using depends on 0.6)
-
@itsCrafted
I have developed this plugin on0.7.x
, so, you could have some problems with 0.6.
Where do you edit source file/template of your theme?If you want to add import to your theme, you should edit initial template of the theme (under
node_modules
) and don't forget to restart your forum. -
@itsCrafted
For Profile View (
node_modules/theme_directory/templates/account/profile.tpl
) - https://github.com/NicolasSiver/nodebb-plugin-ns-custom-fields#profile-viewAdd import
<!-- IMPORT partials/account/custom_fields_two_columns.tpl -->
, where do you like, for example after block with general data about user:Note: see last line
-
@Nicolas great, that works, but users can't edit the custom fields. How do I implement this?
edit: can you edit fields from the ACP or manually set them into Redis? this would be fine for me as well :P, my use case is probably quite different -
What do you mean by - users can't edit the custom fields?
They edit defined custom fields under their profile - https://community.nodebb.org/user/itscrafted/edit
Admin defines what custom fields are available for the forum. -
I see.
Answer will be simple: this plugin supports Vanilla/Levander and Persona, and themes that are derived from them.
Plugin isn't aware about custom themes, even if it uses widgets, It's up to theme developer to declare them. -
@itsCrafted said:
through redis-cli
Yes. User fields are stored in Database, you can edit them directly if you wish.
They could be found via key:user:X:ns:custom_fields
, whereX
is an user identifier.