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

Discussion in 'Styling and Customization Questions' started by Amaury, Jul 6, 2015.

  1. Amaury

    Amaury Well-Known Member

    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:

    <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>
    However, it's still showing:

    KHF Likes.PNG

    For reference, I previously used:

    .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: Jul 6, 2015
  2. Russ

    Russ Well-Known Member

    Use that inspector :)



    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 likes this.
  3. Amaury

    Amaury Well-Known Member

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

    Amaury Well-Known Member

    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? ;)
  5. whynot

    whynot Well-Known Member

    Brick? No.
    I have a bucket of water with crushed ice in it.;)
    Amaury likes this.
  6. batpool52!

    batpool52! Well-Known Member

    For future reference, the actual code is generated is from a template helper XenForo_Template_Helper_Core::helperLikesHtml :)
    Amaury likes this.

Share This Page