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

XF 1.4 Hiding Likes Bar by Commenting It Out

Amaury

Well-known member
#1
Per discussion in my hiding elements thread, I'm going to be commenting out wherever possible rather than using display: none.

I am having problems hiding the likes bar. In the template post, I made the following change:

Code:
<xen:comment><xen:if is="{$post.canLike}">
                    <a href="{xen:link posts/like, $post}" class="LikeLink item control {xen:if $post.like_date, unlike, like}" data-container="#likes-post-{$post.post_id}"><span></span><span class="LikeLabel">{xen:if $post.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
                </xen:if></xen:comment>
However, it's still showing:

KHF Likes.PNG

For reference, I previously used:

Code:
.message .likesSummary {
    display: none !important;
}
Edit: Yeah, I'm an idiot. That has to do with the likes/unlike bar on the controls bar, so my change above did work, just not where I wanted it to. Now to find which template the likes bar comes from.
 
Last edited:

Russ

Well-known member
#2
Use that inspector :)

Screenshot_6.png


Search:

Code:
likesSummary secondaryContent
Template found: likes_summary

You can comment that code... or do a step further:

Search for:

likes_summary now

They pull the likes_summary in a lot of places, so you can comment out all of that template, or if you want specific areas look at what templates likes_summary is included in.
 

Amaury

Well-known member
#3
Thanks, @Russ. I did do a template search for some of the phrases, such as likes_user1_user2_user3_and_x_others_like_this, but it returned no results.

Yeah, I'll be hiding it everywhere because of the way we have likes set up, where you click a View Likes: X link on posts and profile posts and it brings up the overlay. By default, at least four people have to have liked something for to be able to bring up the overlay.
 

Amaury

Well-known member
#4
Actually, when I went to Templates and narrowed it down to "likes" the likes_summary template did show up, but I went into the post_likes template. Then I got distracted and then you posted.

I think someone should hit me in the head with a brick. Any volunteers? ;)
 

batpool52!

Well-known member
#6
I did do a template search for some of the phrases, such as likes_user1_user2_user3_and_x_others_like_this, but it returned no results.
For future reference, the actual code is generated is from a template helper XenForo_Template_Helper_Core::helperLikesHtml :)