Here’s another simple but hopefully useful plugin. It allows you to easily apply a gmail-style alphabet image as an end user’s avatar when they haven’t uploaded a profile picture. The plugin returns an image representing the first letter of the user’s name, or indeed any text you point it to.
Thats cool!
I built this for my own app but found it too much work to conditionally change the color based on the letters. Let alone convert it into a plugin
How have you handled this? Is it generating a random color or are the letters connected to a color?
Already implemented, super easy to setup! Also curious about the colors, are they randomly generated? Any chance to grab them from a list or something?
@vincent56, good question. I’m using a set of images available here - https://github.com/eladnava/material-letter-icons. It’s a fixed set and only one for each letter I’m afraid. So the colours are not customisable or even random. I would have released the plugin a week ago but I was trying a different approach that would generate the images on the fly with a random colour, and the option to use two initials but it was beyond my basic JS skills, unfortunately. I have found some code that can be adapted if anyone with more knowledge is interested in building an advanced version. For now, I thought this was better than nothing
@jordan.shotwell, glad to hear it. As above, it’s one image and colour per letter. I hope this is not too much of a problem for you.
Setting up an API to access shared assets in the plugin might be a bit tricky, for my skills at least - if that’s what you mean. I’m not even sure Bubble supports that yet. That being said, you should be able to save the returned image of an instance of the plugin, using a workflow. For example, below, I’m creating a channel record and setting its default_image field to the plugin’s current image. You could, in the same way, save an Alphabet image to a user record as part of the sign-up process, if you so wished.
All right. I wondered also if Bubble supports this, because I wanted to do an update of the whole Users table with a Scheduled workflow (so with no JS code on a page).
Someday maybe !
Thanks anyway for your response and for sharing your plugin with the community.
No I’m not I’m afraid. Is image_name the filename of an image that you have tried to upload? I would suggest trying the plugin on a fresh page with just the elements that it needs and no other plugins. You can then start a process of elimination to determine what’s causing the error.