Forum Discussion

VincentGabou's avatar
11 years ago

Replicate Me Too component, or any ID-required non-contract component to a custom component

Hello,

 

I am currently trying to integrate a Q&A page that will be extensively customized. One of the "customization" I was trying to implement was to be able to have "Me Too" button on the Q&A main page (listing recent open and resolved questions) for every listed question.

 

I have found in the Studio the name of the "Me Too" component ( <component id="ratings.widget.rating-enum-display" ratingSystemRef="conv:question_metoo"/> ). However, it makes sense that I have to send the ID of every question I want the "Me Too" button for (as of now the button is not rendered for any question on the main page) to this widget. So far I have not been able to find a way to do that.

 

Do you know how we can get access to the actual code of the "non-contract components" of Lithium, so we can figure out how to create "ID-required non-contract" components outside of their designated Pages ? If not, do you think we can recreate the behaviour of the "Me Too" button from scratch (including the logging in part if the user is anonymous, etc.) ?

 

Thank you very much for your help !

 

Best regards

  • 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.

    • VincentGabou's avatar
      VincentGabou
      Guide

      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 :)

      • VincentGabou's avatar
        VincentGabou
        Guide

        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 !