"Default" avatar on member page using DBs and input forms

Hey there! I created a site for a client and it involves using User-Input forms for coaches to create their own profiles with things like contact information and team member names. I have a “create your profile” page which uses user-input forms to store that info on a Database and then I used dynamic pages to create individual profile pages. I also have a “user directory” page with a table that displays all of the coaches using the database. In the user-input form I put the ability to upload a profile picture which is stored in the DB and displayed on both the member pages and the directory table. However, I spent a while designing a special “default” avatar and while I got it to appear on the individual dynamic page for each member profile page, that avatar isn’t actually stored in the database. I basically cheated and put it on the dynamic page and any uploaded profile picture would just go on top of it instead of replacing it. Is there a way to instead make it so that the avatar is the “default” image unless they choose to upload one, in which case it would replace it?

You can use something like the dataset onAfterSave or a data hook to put the URL of the default avatar in the collection when a new profile item is created.

1 Like

Great, I’ll look into that. Thank you very much:)