XF 2.0 [likes] Show thumb x amount >list directly instead of names? + Show likes behind thread?

Cannabis Ape

Active member
To show what I mean I got some screenshots.
1, show amount of likes and list directly instead of names. Except I would like the word Likes x ,
thanks.webp

2, show the likes of the first post after the thread title in categories, before the sticky pin and eye if you follow.
like1.webp

3 I've been trying this unsuccessfully, can I separate the like button in a post and place it on the same line as the like bar that shows up after someone liked?

Cheers.
 
In thread_list_macros, find
HTML:
<div class="structItem-title">
[...]
</div>
Insert before the closing div tag:
HTML:
                <xf:if is="{$thread.first_post_likes}">
                    <i class="actionBar-action actionBar-action--like" aria-hidden="true"></i> x {$thread.first_post_likes}
                </xf:if>

158-20.11.32-27.05.2018.webp

In post_macros, replace
HTML:
<xf:likes content="{$post}" url="{{ link('posts/likes', $post) }}" />
with
HTML:
<a href="{{ link('posts/likes', $post) }}" data-xf-click="overlay"><bdi><i class="actionBar-action actionBar-action--like" aria-hidden="true"></i> x {$post.likes}</bdi></a>

159-20.20.46-27.05.2018.webp

Apply styling as needed.
 
In thread_list_macros, find
HTML:
<div class="structItem-title">
[...]
</div>
Insert before the closing div tag:
HTML:
                <xf:if is="{$thread.first_post_likes}">
                    <i class="actionBar-action actionBar-action--like" aria-hidden="true"></i> x {$thread.first_post_likes}
                </xf:if>

View attachment 176581

In post_macros, replace
HTML:
<xf:likes content="{$post}" url="{{ link('posts/likes', $post) }}" />
with
HTML:
<a href="{{ link('posts/likes', $post) }}" data-xf-click="overlay"><bdi><i class="actionBar-action actionBar-action--like" aria-hidden="true"></i> x {$post.likes}</bdi></a>

View attachment 176582

Apply styling as needed.
Hey man, still happy with this trick but I tried to style it so the thumb and amount would be a little smaller.

Now I got the thumb a bit smaller but I can't seem to get the amount smaller as it changes text on other spots too.

How can I only get the amount smaller?
 
@S Thomas
Added the line and tried sizing with this:
Code:
.actionBar-action.actionBar-action--like.actionBar-action--text {
    font-size: 12px;
}
But it only sizes the thumb and not the text, what am I missing?
 
Last edited:
Oh, misunderstanding.

In thread_list_macros , you've added:
HTML:
                <xf:if is="{$thread.first_post_likes}">
                    <i class="actionBar-action actionBar-action--like" aria-hidden="true"></i> x {$thread.first_post_likes}
                </xf:if>
Replace that with
HTML:
                <xf:if is="{$thread.first_post_likes}">
                    <i class="actionBar-action actionBar-action--like" aria-hidden="true"></i><span class="actionBar-action--text"> x {$thread.first_post_likes}</span>
                </xf:if>
And then style it with that class.
CSS:
.actionBar-action--text {
    font-size: 5px;
}
 
Sup! I'm still using this :) but now have an additional question. What do I need to add/change to set them at the end of the line, just before the "Replies:" so that all of them are aligned the same :)

I can do it manually with position, left 669px but yeah, not really responsive gheghe

Cheers
 
Last edited:
Back
Top Bottom