Creating a Like/Save Feature with Memberstack in Webflow: A Step-by-Step Tutorial

Published on
January 24, 2020

Understanding Memberstack and Building a Like/Save Feature in Webflow

If you're looking to add a like or save feature to your Webflow website, Memberstack is the solution for you. In this tutorial, we'll walk you through building a like or save feature using Memberstack with detailed step-by-step guidance.

What is Memberstack?

Memberstack is a robust tool for creating membership-based websites within the Webflow platform. With Memberstack, you can create personalized user experiences, including features like saving, liking, and bookmarking items, all of which can be accessed on an account page or any desired location on the website.

Setting Up Memberstack for Like/Save Functionality

Before diving into the implementation, you need to ensure that Memberstack is set up for your Webflow project. If you haven't already done this, you can follow the steps below:

  1. Signup and Installation: Navigate to the Memberstack website, sign up for an account, and integrate it into your Webflow project by following the installation instructions provided.

  2. Defining Classes: Within the Webflow designer, define specific classes for the elements you want users to like or save. For instance, you may define a class for the 'like' button, the parent wrapper for the item, a title, the row structure for liked items, and a span for displaying the total count of liked items.

Implementing the Like/Save Feature

Step 1: Checking User Login Status

In this step, we'll ensure that the like or save functionality is only available to signed-in users.

  • Code Block 1: Place the script provided by Memberstack at the end of the body tag to establish the connection with Memberstack. Also, add your custom script, ensuring that the Memberstack ID matches your account.

  • Code Block 2: Here, a JavaScript function checks if the user is logged in and retrieves the metadata object to determine if the user has liked any items previously. If not, it initializes an empty array to start saving this information.

Step 2: Implementing Like/Save Functionality

  • Button Click Function: Upon clicking the 'like' button, a function is triggered to capture the name of the liked item and add it to the metadata if it doesn't already exist.

  • Visual Update: The total count of liked items is updated, and the metadata is stored to reflect the user's current liking activity.

  • Cloning and Appending: The liked item is visually added to the user's liked items section using JavaScript's clone and append functionality.

Step 3: Displaying Liked Items On Another Page (Optional)

If you intend to display liked items on a different page, this step involves ensuring that the original list of liked items is accessible through JavaScript. The original list is hidden from the user, and the liked items are displayed based on the metadata saved within Memberstack.

Summary

By following these steps, you can successfully implement a like or save feature using Memberstack within your Webflow project. Remember to customize the provided JavaScript according to your specific class names and desired user interactions. It's important to test the feature thoroughly to ensure seamless functionality across different user scenarios.


This tutorial guides beginners through the process of setting up Memberstack and implementing a like or save feature in Webflow. It covers the necessary code and steps required to achieve this functionality, ensuring a personalized user experience on your website. If you're new to building interactive features in Webflow, don't hesitate to give this tutorial a try.