bengott/meteor-avatar

customImageProperty

Closed this issue · 3 comments

If I got it right, this property should allow to specify where in the user's object we store some URL which leads to any pic.

Something like this I suppose:

customImageProperty: "services.someOtherField.fieldWIthUrlAsValue"

Is that right?

If yes, then can someone give a small example of how to use it, because it doesn't work like this for me. Yes I do publish and subscribe those fields.

If not then can someone clarify me of what that property is and is it somehow possible to tell the avatar package to use a custom (not twitter or facebook, etc.) url for a pic from a user's object.

Yes, that's how it's supposed to work. It looks like you're specifying the right way, so maybe there's a bug here. Can you share your code? Or maybe set up a simple reproduction using http://meteorpad.com ?

It's a lot of code so would take some time getting it done in meteorpad, so I will upload some pics to show what is not working for me.

So I made a test page for the avatar.

htmlpart

Here is the js part of it.

jspart

And the options file for avatar. I did try different configurations here, with just a random pic as default image from internet and etc. so if I uncomment the defaultImageUrl it will show that image instead of showing initials, but my goal is to show a custom one, not a default one.

avaoptions

This is the console output, just for testing purpose I post all data associated with the account.

consoleobj

And this is what I get in the browser window.

browseroutput

So in the end it just shows initials instead of loading the image from the user object specified property. I am not sure, maybe I miss something. I tried specifying different urls not just the one in the console output there, yet it still showed initials. My goal is to allow the user to link to any pic from any source in the internet and save it in his user object and just link to it with "customProperty".

It also shows initials because the registered account is not linked to any other service and doesn't have a registered gravatar with the registered email, so in that case it should show initials as it suppose to but it ignores the customProperty thing.

From the docs I understood that it will go through different services according to priority and whenever it finds something to show, it will be going through the services up until gravatar as last. If that fails too, it will look into customProperty if specified, if not it will check for default parameters like initials or default image. Yet it kind of looks like it ignores the customProperty and just skips to a default fallbackType. So I am not sure if I just not specifying something specific or just use it wrong or it just ignores for some reason my option input.

Fixed the issue, was totally on my end. Was still using the bengott:avatar version (which doesn't have that property), after I updated it worked as intended.