Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hi,
is there any setting in voting api where i can select some of content types to be voted not all?
any help is appreciated
Comments
Comment #1
galundin CreditAttribution: galundin commentedYes, when you set up your voting widget, you have to tell it which types of content it will appear on. Do you know which voting widget you're using?
Comment #2
keti-1931 CreditAttribution: keti-1931 commentedwidget .... u mean five star and all?
no i am thinking of using api only no widget
Comment #3
galundin CreditAttribution: galundin commentedVoting API doesn't do anything by itself unless you're writing custom PHP code to create votes with function calls. Other than that, you must install an additional module to provide a UI widget. The widget is the front-end that users interact with, while Voting API is the back-end, which only handles storage and calculations and Views integration, etc.
Can you be more specific about what you're trying to do?
Comment #4
keti-1931 CreditAttribution: keti-1931 commentedsay i have a content type test 1 , test 2 , test 3 and i want to calculate votes for test 1, test 2 and not for test 3 so how do i go.
i dont want to use widget due to some reasons.
Comment #5
torotil CreditAttribution: torotil commentedVoting doesn't care about that. It calculates vote results for all entities that have votes. So to don't calculate votes for type test3 just don't insert votes for nodes of type test3.
Comment #6
keti-1931 CreditAttribution: keti-1931 commentedvotes??
i didnt understand. can u tell me how to insert votes for entities??
Comment #7
galundin CreditAttribution: galundin commentedVotes are inserted by PHP code that calls functions offered by Voting API. That's what an API is: "Application Programming Interface." It is a specification of data structures, functions, and other technical details related to programming. You cannot use Voting API directly unless you know how to program in PHP. That is why you need a widget module. A voting widget is a PHP program that creates votes.
Perhaps what you want is to allow authors to assign vote values to their own content, but not allow others to vote on it. To do that, add a Fivestar field to the proper content type(s) and choose "rated while editing" in the configuration of those Fivestar fields, instead of "rated while viewing."
If that isn't what you want, please be more specific. We don't necessarily need to know your reasons, just describe how you want it to work.
Comment #8
TR CreditAttribution: TR commentedThis support request has been answered.
Comment #9
TR CreditAttribution: TR commented