I need to add new button to Sidebar (or some other place possible to discuss too), which will simply toggle user’s custom field value. We set up “SFW” mode, by basically inverting this approach. But as the value is optional to set by user and the website is NSFW by default, it would take time for one user to get into their profile settings in order to find tiny and non-evident checkbox.
That’s why the idea of putting a button with two states (On/Off) which will change the custom field’s value for the user. The default state is NSWF (unchecked user’s field, or 0). The second state is SFW (checked user’s field)
When do you need it done?
It seems to me it should be a quick task for experienced theme-component developer Take your time
What is your budget, in $ USD that you can offer for this task?
Okay haven’t played with it yet. but there is also page publishing.
I would imagine the code may help to get some ideas. There are a few components that use user fields. A more recent addition is a kind of watched words for the member that will hide? posts with word term.
There are also some theme-components that use a switch toggle in iirc Hamburger menu or header.
Custom header links may work as well possibly.
I am not sure but with a checkbox? you might be able to copy the link for that user prefer checkbox.
Thanks need to update the site address. The client changed from.ai to .com.
The idea I meant above. You could look at the source fir the User field prompt to get an idea for the code you need to toggle your nsfw user setting. Then look at maybe something like the Thene-component Light/Dark toggle and combine ideas for the toggle to manipulate your nsfw user setting.
It does what you talk about. Looks into the user’s field value and sets CSS class via JS. Please make sure you use the code from this message as the base one, because the one used in the first post there relies on deprecated Discourse methods.
As for toggle itself, and your reference to Dark/Light toggle, I guess it may be interesting to look into it for the future developers of this component I’d like to share to public as soon as it’s finished. @Lhc_fl is working now on something and we will hopefully be able to test it ourselves in production first