1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Change avatar variable's html ?

Discussion in 'Styling and Customization Questions' started by eva2000, Jul 4, 2014.

  1. eva2000

    eva2000 Well-Known Member

    I want to add an onload event to the img tag for the avatars in recent threads and search results but searching the templates all I find is this
    <xen:avatar user="$thread" size="s" img="true" />
    so where do I go to edit the html itself ?
    <img src="data/avatars/s/0/1.jpg?1400874594" width="48" height="48" onload="XXX">
    thanks :)
  2. RoldanLT

    RoldanLT Well-Known Member

    This is for ngx_pagespeed?
  3. eva2000

    eva2000 Well-Known Member

    sort of, until ngx_pagespeed's lazy load filter is working again trying some manual lazy loading :D
    Last edited: Jul 4, 2014
    RoldanLT likes this.
  4. Chris D

    Chris D XenForo Developer Staff Member

    Check out the file:


    Look for: helperAvatarHtml

    There are two ways of displaying avatars.

    Img mode:
    $image "<img src=\"{$src}\" width=\"{$dimension}\" height=\"{$dimension}\" alt=\"{$username}\" />";
    And background mode:
    $image "<span class=\"img {$size}\" style=\"background-image: url('{$src}')\">{$text}</span>";
    It's not easily possible to extend that code, though it is possible to override it completely but that would affect other add-ons.
    eva2000 likes this.
  5. eva2000

    eva2000 Well-Known Member

    Thanks Chris (y)
  6. RoldanLT

    RoldanLT Well-Known Member

    So your editing core files directly? Just for the lazy load to work :D
  7. eva2000

    eva2000 Well-Known Member

Share This Page