• 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

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.
 
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.
 
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.

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?
 
Back
Top