How do I extend the user summary with Plugin Store data

Hi, I’m trying to create a plugin that will enable users to endorse each other (writing a brief testimonial for someone else). The results I am going for is pictured below :point_down:

I am thinking to add a section to the user Summary page that houses a user’s endorsements and enables users to create new endorsements.

I am having trouble figuring out how to extend the user summary with Plugin Store data. If I could get the data loaded initially, it seems straightforward enough to use actions in the controller for other CRUD. The challenge right now is getting that data into the view initially. How might I go about this?

I have tried extending the Controller, which seems like the wrong place to be fetching that data.

It seems like extending the user_summary.rb model is the place to be doing this, but I am confused as to how to get that data from the Plugin Store and serialize it (?) and get it into the view.

Can you help me?

2 Likes

https://github.com/discourse/discourse-solved/blob/5b81cc92934f6cf4ca4a71fde206bd3e66c39452/plugin.rb#L229-L237

#plugin:solved extends user_summary page to display solved_count value. Here you can use PluginStore data instead of UserAction.

Also a similar plugin is already exist in GitHub
https://github.com/JafethDC/discourse-user-feedback

7 Likes

Thanks for the quick reply @vinothkannans. This #plugin:solved example is helpful and wow, I searched for plugins similar and failed to find @jafeth.diazc’s plugin, thanks for pointing that out!

1 Like

Wow that one star review is brutal. :rofl:

6 Likes