inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2014 16:57:15 GMT -8
I would like to be able to make a link directly to the avatar without ProBoards' automatic injection of a div and img, I'd like to just have a way to link to the avatar directly inside my forum templates.
For $[user.avatar] you get:
<div class=" avatar-wrapper="" avatar_size_default="" avatar-1"=""><img src="http://i.imgur.com/wQa8Qbq.png" alt="leif Avatar"></div>
A lot of that is unnecessary for me. I'd just like:
http://i.imgur.com/wQa8Qbq.png
That's it.
|
|
inherit
208650
0
May 9, 2014 14:58:45 GMT -8
JScript
5
April 2014
jscript
|
Post by JScript on Apr 29, 2014 17:20:32 GMT -8
Hi,
Try this:
Go to -> Forum > Admin Home > Themes > Layout Templates and select [Forum Wrapper] Then search this $[head], and add the code below after:
<script type="text/javascript"> // <![CDATA[ var user_avatar_link = '$[current_user.avatar]'; user_avatar_link = jQuery(user_avatar_link).children('img').attr('src'); /* console.log(user_avatar_link); */ // ]]> </script>
And then just use the new variable user_avatar_link in your code!
Best regards,
JS
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2014 17:28:33 GMT -8
Unfortunately that did not work.
<div style="width:100%;height:300px;background-image: url('http://placehold.it/200x300');background-image: url('user_avatar_link');background-size:cover;text-align:center;"><div class="ashyavatar"><div class="ashyinside">
|
|
inherit
208650
0
May 9, 2014 14:58:45 GMT -8
JScript
5
April 2014
jscript
|
Post by JScript on Apr 29, 2014 17:55:11 GMT -8
leifHi! JavaScript and HTML are two different things! HTML doesn't have variables and It certainly doesn't have Javascript's. HTML is a markup language, not a programming language. You can't place a this JavaScript variable anywhere in HTML document. Instead you need to get the DOM element through script and append what you want!
Edit: Try this example: Result:So long, JS
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2014 19:07:22 GMT -8
Thank you. However that would not work as I do not wish it to be the current user, but, as a replacement to user.avatar not current.user.avatar
|
|
inherit
208650
0
May 9, 2014 14:58:45 GMT -8
JScript
5
April 2014
jscript
|
Post by JScript on Apr 29, 2014 19:54:48 GMT -8
@ leifAlthough I only met ProBoard yesterday (2014-04-30), I know that there are several variables predefined by the system, see these four below: However, if you specify in more detail what you want to do, oh yes, I assure you will have the help you need! So long, JS
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 30, 2014 7:30:42 GMT -8
Thanks for trying. Unfortunately I'm hoping to use this in mini profile. There's a work around but something like this added to proboards will save lines of CSS and make hover profiles simpler for those that prefer to use their avatar field. I'm surprised this isn't an option yet.
|
|
#eb7100
33409
0
1
May 3, 2024 16:38:41 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Apr 30, 2014 8:14:57 GMT -8
Labeled as a feature request.
I'd assume the variable would end up being $[user.avatar.src] if this were accepted.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 30, 2014 14:47:27 GMT -8
That'd be perfect :]
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on May 3, 2014 19:44:09 GMT -8
By any chance does anyone know of any decent way around this for now? To make a custom field ID be the exact same thing as the avatar link perhaps?
$[user.avatar.src] would be perfect but I'm an impatient person and am using a custom profile field as a workaround with avatars completely disabled for now.
|
|
#eb7100
33409
0
1
May 3, 2024 16:38:41 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on May 4, 2014 8:27:14 GMT -8
A custom profile field could easily accomplish it.
For example, here's how you would create the regular avatar div with a custom field.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on May 15, 2014 8:05:57 GMT -8
I ended up just remaining the use of Hover Image field, when and if the $[user.avatar.src] comes out I can easily switch it over.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Oct 23, 2014 21:09:17 GMT -8
Just wanted to say I'm still very interested in this. Custom Profile Fields is how a lot of us do it. But; it'd be amazing if we can just pull the avatar link one day.
|
|
#e61919
Support Manager
154778
0
1
May 3, 2024 16:11:00 GMT -8
Michael
19,550
May 2010
wiseowl
|
Post by Michael on Oct 24, 2014 8:37:04 GMT -8
Still listed as a feature request!
|
|