I’m new to Glide and I’m starting with the Instagram look alike template to build my own app. I followed the dedicated tutorial but I still have some issues to do the same and to implement other things.
I wonder how I can proceed to display a default image if the user does not select one with the image picker, not to see a blank square in the feed.
First, you have the image picker which allows your users to pick a profile image, pointing on a column. OK.
Add a template column in the Glide data editor, containing the image or url of the default picture.
Then, add an if/then/else column in the data editor : if “user image” is empty then “default image” else “user image”. This way, this if column will always contains an image, either the user’s one, either the default one.
In your app, the image component will point on the if/then/else column.
Great quick explanation. I’ve done this in some of my apps and it really gives a way more polished look (as opposed to the first letters of the users’ names). It’s especially awesome when doing a relation to the user profile. Having a default “person icon” next to the name really makes it look like a link to the person’s profile.
Only thing left to refine for profile images is the ability to set an image as the app user’s profile image (for the menu icon and comments icon).
Thank you for your help. It really seem the appropriate answer!
However I can’t manage to do that part : “Add a template column in the Glide data editor, containing the image or url of the default picture.”
How to actually upload the image in the data editor (and not the Google sheet right?)?
Moreover, it seems that the image picker won’t point on the if/then/else column if it is absent from the Google sheet.
You could do that. I prefer placing the image URL in a sheet of “Resources” that also include my choice component options. Then I use a single value data column to pull in the image.
You are trying to place the location of the image from your desktop. You first need to either upload it to google drive and share it to get a public url. Or you could temporarily drag and drop the image into an image component, which will upload the image to glide’s firebase server, or you could temporarily use an image picker component to upload the image. Once the image is uploaded, you will have a url that you can use for the template column.
Thanks Jeff. I have it set when someone adds a contact that it is a default image. Then when they upload a new photo it updates all the previous pictures with the new one.
I have a database where someone may meet someone more than once and it tracks each audition. The default is automatically written so there is always an image with a new contact. Once the user gets a photo of contact then they can edit the image and it updates all related images.
As my image shows, it used to have a default image. But the default image no longer shows up When adding a new contact. It adds contact with no image even though default is set.
I tried 2 different urls where I have the image and neither work any more.