XF 2.1 Pass variable (username) into URL string for [Appearance > Styles > Style properties > Avatars] ?

SFFNetwork

Member
Currently our forum uses dynamic default avatars (the dynamically generated letter and color), and while these work fine, they are fairly boring. We are hoping to instead use something like tinygraphs, which allows one to append a value to a URL (like so: http://tinygraphs.com/squares/[value]), and then use it to return a randomly generated avatar using the [value] supplied as a seed. Our thinking is that by inserting usernames as the [value], we can generate unique avatars for everyone that are more aesthetically pleasing.

In Appearance > Styles > Style properties > Avatars, there is a "Default avatar image URL" setting, and so I am wondering if there would be a way for me to enter something like http://tinygraphs.com/squares/"{$xf.user.username}" in this setting such that everywhere the default avatar is generated and displayed, we could pass the username of the avatar's associated user into the URL, and thus produce their unique avatar. Is something like this possible to do? And if not, is there a template for default avatars that could be edited to produce this result?

Thanks!
 
I love the idea of this. Having unique avatars as a default.

That said, I don't particularly love the tiny graphs output, but it is interesting.

I looked at where that url is used. Unfortunately that's used in a .less css file, so I don't think it's easy -- since you can't use xenforo variables in there. Alternatively, you could perhaps override the style in the template in the appropriate places, but it would have to be in multiple places, so it's not straightforward, I don't think.
 
Alternatively, you could perhaps override the style in the template in the appropriate places, but it would have to be in multiple places, so it's not straightforward, I don't think.

Yep, this is more or less what I am trying to avoid. I didn't know that the setting populated in a less file, though, that's very helpful to know!
 
Back
Top Bottom