In a discussion about editing user.hbs within a Discourse plugin, stevenpslade reported that moving publicUserFields above bio had no effect. cpradio suggested verifying the register_asset directive in the plugin.rb file, which stevenpslade confirmed was already in place. While cpradio demonstrated the fix working on their local installation, stevenpslade initially struggled, noting a discrepancy between the expected plugin path and the jsapp compiled directory stevenpslade. After clearing both browser and Discourse caches, stevenpslade discovered that another plugin was interfering with the layout. Upon disabling all other plugins, the changes worked immediately stevenpslade. Although they successfully re-enabled the plugins one by one without issues, the specific conflicting plugin remained unidentified, leading cpradio to joke that the mystery remains cpradio.
I am trying to modify the user.hbs file my plugin. Doing the standard plugins/myplugin/assets/javascripts/discourse/templates/user/user.hbs and copying the original code and modifying what I need. However, the result is that nothing changes. I am just moving publicUserFields above bio. Any ideas why?
Also, more advanced conversation on this topic that I would be curious to know: Could one create a widget to alter the profile using a virtual dom approach?
I did a search of my entire local Discourse for all instances of the user.hbs code. The two results were in my plugin and the following: discourse/jsapp/templates/user/user.hbs
We would have expected the other one to be assets/javascripts/discourse/templates/user/user.hbs, right?
So what is jsapp? This could be the reason it is not working for me, because the plugin path does not match what I have on my local discourse.
jsapp (to my knowledge, @eviltrout, correct me where I’m wrong), is the compiled version of Discourse. So it is what actually gets executed, but the code for altering exists in app/assets/javascripts/discourse/templates/user.
You might want to clear your Discourse cache too, rm -Rf tmp/cache/ which would be inside your discourse implementation.
Are you running this locally using the Ubuntu Development guide or via Docker?
So I removed all my plugins except the profile alternate layout. Then I slowly added them all back in one by one. Everything working correctly. Updated profile layout to make sure change would work, everything working correctly.