1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

How to add item cover image in sidebar

Discussion in 'Showcase Support' started by Sadiq6210, Oct 14, 2015.

  1. Sadiq6210

    Sadiq6210 Member Showcase

    Hello,

    I am trying to replace the user avatar with item cover image in (Recent comments sidebar)

    upload_2015-10-14_13-54-18.png

    I want to show the "item cover image" instead of "user avatar who added the comment"

    In template (nflj_showcase_index_sidebar)
    I searched for:
    Code:
    <xen:avatar user="$comment" size="s" img="true" href="{xen:link showcase/comment, $comment}" class="NoOverlay" />
    
    Then I replaced it with:
    Code:
    <a class="avatar NoOverlay" href="{xen:link showcase, $useritem}">
        <img width="48" height="48" border="0" src="{$useritem.cover_image.thumbnailUrl}" />
    </a>
    But the variable {$useritem.cover_image.thumbnailUrl} is not working in this template
    I will appreciate if you can help to do this.
     
  2. Bob

    Bob Developer Staff Member

    What you want to do would require custom development as Showcase Item data like attachments are NOT fetched and prepared when fetching comments. Attachments for a Showcase Item are only fetched and prepared when fetching Showcase Items themselves (same with custom fields).

    btw, the variable $useritem is from the array $useritems which has NOTHING to do with comments. That Array of data is fetched and prepared for use in the Showcase Item Sidebar and contains Showcase Item Records for other Showcase Items that the Author of the Showcase Item you are viewing owns.
     
  3. Sadiq6210

    Sadiq6210 Member Showcase

    Thanks Bob
    I will try to do it
    Any hint from you will be much appreciated i.e which file I need to modify? and can I take the same code for $useritem to create new variable?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.