Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

ViewsView Examples
How to Add a Like or Add to Favorites Button

How to Add a Like or Add to Favorites Button

If you have a View where you would like users to be able to select specific entries to "like" and add to their list of favorites, follow the directions below to set this up. See an example of a Add to Favorites/Like button. This will only work for logged-in users.

Create Add to Favorites / Like Button Form

  1. Create a form titled Add to Favorites. Add a Dynamic field and UserID field.
    • In the Dynamic field, set it up to Load options From the form that is being used in your main View. Select the title or name field if you have one; if not, any other field is fine. Display as a dropdown with Visibility set to Administrator.
    • Add [get param=entry] as the default value. This field will be used to grab the ID of each entry that users "like". Dynamic Default Value
    • If you would like to prevent users from "liking" the same entry multiple times, add this code to your theme functions.php file or your own plugin. Make sure to change 125 (in the code example) to the ID of your Dynamic field.
  2. In the form Settings for the Add to Favorites form, do the following:
    • In the Confirmation action, set up Redirect to URL and leave the URL box blank
    • In the General Settings, select Submit this form with AJAX
    • In the Form Permissions, select Limit form visibility and choose Logged-in Users from the dropdown.
    • Select the Allow front-end editing of entries checkbox and set Logged-in users as the role required to edit one's own entries.
    • In the Buttons, change the Submit Button Text to Add to favorites or any other text.
  3. Go into edit your main View.
    • Make sure that you have created a Detail Page. In the View builder settings, go to the Advanced Settings section and set the Detail Page Slug to entry. If you already have a parameter name that you don't want to change, you could add another parameter to your detail link so it looks like this: [detaillink]&entry=[id]. Add to Favorites - Detail Page Slug
    • In the dynamic content, insert your "Add to Favorites" form like this:
      [formidable id=31 minimize=1]

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Display List of Users Who Favorited an Entry

If you would like to see a list of users who have "liked" each listing, follow the instructions below.

  1. Create a View for the "Add to Favorites" form.
  2. Set it to display All Entries.
  3. Put this in the content:
    <div id="frm_container_[id]">
    [981 show="display_name"][deletelink label="Remove from Favorites" prefix="frm_container_"]
    </div>

    Change '981' to the ID of your userID field.

  4. Add a filter in the Advanced Settings at the bottom that sets your Dynamic field equal to [get param=entry].
  5. Go into edit your main View and in the dynamic content, insert your new View you have just created.

Show a User Their Favorite Entries

If you want your users to be able to see all the entries they have "favorited", follow, these instructions below.

  1. Create a View called "Favorite Listings" that uses entries from the "Add to Favorites" form.
  2. Set it to display All Entries.
  3. Add any content you would like. If you want to add a "Remove from Favorites" link, add an opening div and closing div around the content with a deletelink included so it will look something like this:
    <div id="frm_container_[id]">
    Your content here
    [deletelink label="Remove from favorites" prefix="frm_container_"]
    </div>
  4. Add a filter in the Advanced Settings at the bottom that says 'UserID is equal to current_user'. Create View Filter User ID
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Special offer unlocked.
    Get 55% OFF!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms