Forum Discussion
Hi VincentGabou - I did not find any get/post API for metoo, so I think there is a little chance that it can be customized. Lithium does not expose the code for the non-contract components.
- VincentGabou11 years agoGuide
Thank you for your quick answer !
I thought that a "Me Too" could be a achieved by creating a Rating with the following rest call :
rest("/messages/id/MESSAGE_ID/ratings/key/question_metoo/ratings/add?rating.value=0.0")
As for the non-contract component, we don't need the actual code per se, but the knowledge of what parameter to pass to the component for it to apply to a given Question for example. We would be perfectly happy with just calling the non-contract component with :
<component id="ratings.widget.rating-enum-display" ratingSystemRef="conv:question_metoo"/>
and adding a parameter for the widget to recognize what message to apply the "Me Too" to.
Do you think it is possible ?
Thanks again for your help :)
- VincentGabou11 years agoGuide
I'm sorry to "up" my question, but maybe someone knows a way to do what I am trying to achieve ?
Thanks again for your help !
- AdamA11 years agoKhoros Oracle
Hello,
Currently there is no way to directly parameterize the ratings.widget.rating-enum-display component for a specific Question. This component will attempt to get the object it is rating from its context. If used in the context of a Question component, then it will give the me too rating to the Question. If not used within a component that has a "ratable object" then it will attempt to get of the ratable item from the URL. Since you plan to use this on the Q&A main page, there will not be an ID for a Question in the URL path, and there is no simple way to add one that will be picked up by this component.
I think a good improvement for the existing component would be to allow the parameterization of the ratable object. You might consider submitting this as an Idea or as a services engagement. Otherwise I think you would need to try and replicate the functionality using the REST API.
- VincentGabou11 years agoGuide
Hello Adam,
Thank you very much for these precisions ! I think I will indeed submit an Idea to make this "Me Too" a little bit more reusable.
In the meantime as you suggested, I think I will have to replicate the behaviour by hand, that is, redirect to the login page if the user is not connected (with a fallback_url), and make a rest call to add a Me Too if the user is already logged in.
That said, and juste to be sure, is the correct API call the one i suggested earlier, i.e. :
rest("/messages/id/MESSAGE_ID/ratings/key/question_metoo/ratings/add?rating.value=0.0")
?
Thanks again for your help :)
Related Content
- 4 years agoInactive User
- 4 months ago