Create User "Favorites"?

Support MB Relationships Create User "Favorites"?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17854
    TravisEstesTravisEstes
    Participant

    Is there a way to create User "Favorites" using MB Relationships and Front End Forms?

    So basically:
    - User clicks a button to mark a post or User a "Favorite"
    - That user's favorites can be displayed in a list for them
    - Users can have multiple favorites. Their favorites are unique to them

    I'm currently using another plugin for this that doesn't feel super stable, so wondering if there's a way to do this with MB's! I have tried but can't figure this out.

    #17861
    Anh TranAnh Tran
    Keymaster

    Hi,

    Thanks for asking a great question.

    While I think it's totally doable with Meta Box, it requires custom coding. I imagine the steps will be like this:

    User clicks a button to mark a post or User a “Favorite”

    • Add a custom link to the post for users to mark as a favorite
    • When clicking that link, send an Ajax request to do the job
    • In the Ajax callback, use MB_Relationship_API::add to create connections between users and posts

    That user’s favorites can be displayed in a list for them

    This can be done with the code in the documentation.

    Users can have multiple favorites. Their favorites are unique to them

    Just set the relationship as many-to-many (default) and MB Relationships can handle the rest.

    I hope that can give you some ideas. Unfortunately, I can't provide ready-to-use code.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.