Allow users to “save” pages? (UNSOLVED)

Hello all,

I have a situation that I’m assuming would require some mix of coding and creativity.

I want to allow members of my site to be able to “save” a page for their own reference at a later time, so that they can go to their member profile page (or another page) and see all the pages they “saved.”

I was thinking that may be I could set-up an element, which upon click would collect the URL of the current page, and add it to a collection. Then, I could set-up a separate member-specific page, where they will see all the URLs they saved by pulling the information saved from that collection (and may be giving them some permissions to alter or delete the data).

What do you all think? Anyone savvy enough with Wix coding to accomplish this?

P.S.: I apparently have a tendency to overthink things when it comes to coding, so if you can think of an easier way, I am all ears… I just want to allow the users to have customized experiences at my Wix website.

Thank you all.

Raghav Suri, Psy.D.
Clinical psychologist, U.C. Berkeley
License # 29173

.com
Be your unique self!

Email is not a confidential form of communication, or primary means to seek mental health services. If you are in need for help, please contact your health clinic, go to the nearest emergency room, or call 911.

Hi Raghav Suri,

First, to grab the current page url call wixLocation.url as demonstrated below:


import wixLocation from 'wix-location';

// ...

let url = wixLocation.url;

Next, store the url in your member collection under the current member.
You can find a step-by-step guide for creating member profile pages here if you haven’t done so already.
The member collection should have an additional column for saved pages.

To store the information you will need to get the current logged in member and Query it against the member collection to find the _id variable, which in our case represents a member.
Once you have the _id, call Update to add the information to the member collection.

To finish the process you will have to write code to fetch the stored pages from within the collection once a visitor navigates to his profile page. This should also be done using a Wix Data query.

Check this out: https://www.wix.com/velo/forum/coding-with-velo/allow-users-to-save-pages-1?appSectionParams=%7B%22origin%22%3A%22member_posts_page%22%7D. It is a much more complete answer!