Site users and Wix Code

I’ve looked through the Wix Code examples where users submit content into database collections - the art school site example and the food review site.

One variant of user submitted content which I’d like to see an example of is where users have to log into the site and have to be members before submitting content. To avoid spam postings for starters but also to create a community.

(a) Is this possible with Wix Code and how?

(b) has anyone build a site like this yet so I could see what’s possible?

(c) What is the maximum number of users a Wix Code site have?

(d) Once users have submitted their content, could they edit it afterwards? eg edit a plain text field. How would you go about doing that in Wix Code?

I can’t find any documentation of the user login/membership aspects of Wix Code, though I notice the term “user” cropping up a lot in the API cheatsheet. If I’ve missed some documentation, please let me know. Thanks

1 Like

Hi Scoobie - lots of good questions…
I’ll address them one by one:

(a). Yes, it’s possible. We have created a permissions model that allows just that. Read more about the permissions model for collections here .
Specifically read about the role “Site Member Author” - it’s exactly what you described.

(b). I’ll let the community answer that…

(c). It is not limited today to any concrete number. We have wix sites with thousands of users and more. What is your estimate for the number of users your site will have?

(d). Yes, it’s possible. You can go about this in different ways. I’ll describe one such direction.
I assume you have a dynamic page for each record submitted by a user.
In that page, you already have a dynamic dataset that fetches that record.
All you need to do is:

  • design an “edit record” form for the user to edit their data through
  • make sure to add a “submit” button
  • change the dataset to read/write mode
  • connect the form’s components to the dataset’s appropriate fields
  • connect the submit button to the submit action
    (*) Make sure the collection permissions allow the “Site Member Author” role to update data. You can view and manage a collection’s permissions settings from the collection’s hover menu on the site navigation tree.

And that’s it! you have now created a form that lets the user change the record they have submitted in the past.

p.s.
One last note - if you let the user update fields that are used to generate the item’s URL, then after the user update is submitted the item’s URL will change… This is probably not the intended behavior you wanted so make sure to block changing those fields.

Good luck and hope that helps!

Thanks for the comprehensive steer, I was looking in the wrong area of the help pages, I was thinking it would be under “users”

It sounds likes you have built Wix Code with the ability to have user managed content , which is great.

I can’t guess the number of users as I know gaining traction with websites is hard work. But I’d be worried if it was less than 10,000 users because that would make me think it’s not that scalable in the very long run.

Scale wise - should not be a problem at all. Good luck gaining traction :wink:

Would there be an advantage to connecting the user generated database to a blog or a Wix forum? Is this even possible with user submitted forms?

My thinking here is it would save building a custom view to display the repeatable content in either a list or grid format and it would enable user commenting quite easily.

Here’s my thinking
User input : Use Wix Members only page and Wix Form to populate Custom Database

Edit user input: As you described above.

Relationship database: Link a Wix blog or Wix forum to the custom database - is this possible?

Read only display : Use a Wix blog or Wix forum. Or is the only way to display user submitted content is to build a dynamic page? I noticed on your roadmap you are building dynamic repeatable elements that link to a database.

Hey Scoobie … I created something similar to what you are asking about…

Visit the site I am working on … You will have to sign up as a member … It’s free …

The “Add a Group” section is wix code/form user input …

My current settings: Only user that created the data can edit ; Only site members can add data ; Public can view entries

www.southtexastrails.com

I had a look at your site thanks, looks good, I submitted a test form which you might want to delete.

The edit button - does that appear on every Group, or just the ones the user has uploaded? Preferably I’d like to figure out how to do the later. What does the edit button connect to - is it a dynamic page URL? What’s the URL format so it lands on the right page?

Note : I did experience some timeout errors on your site, I wonder if that is a bug in the beta

Thanks!

Edit button: appears on all pages, it simply performs the function of entering into edit mode. If you submitted a test form, you would have noticed you can ONLY edit that page, and not the rest that are there. So essentially if you are not the author of the page you are looking at, the button will do nothing.

The URL format is selected in the settings when you first create the dynamic page. It will automatically ask you to “name” the page with the “pattern” of how you want the FIELDS to take a part of the URL name for that page.

Timeouts: Yes, Some functions do not work because they have been switched “on/off” from the development team as they work on different areas of Wix Code. My creation is over a month old. For example the image button upload, it USED to work but now they are working on perfecting that feature so that function no longer works until I go back in there and connect that image upload button function using a work-around wix code. Etc etc etc.

It is my own site. So I only work on it in between my customers-paid sites. : )