Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Remove Social Share from main page

Started by Tanzir Rahman 9 years ago · 8 replies · 1094 views
9 years ago

I added the social share plugin to my blog_item page. Why is it showing on the main blog page, i.e. the list of blog entries? How do I get rid of it?

thirdhandbd.com/blog

Capture|690x136

Thanks.

9 years ago

Where did you add it? In the Twig file?

9 years ago

Yup, added it to the Twig file. I thought that's how it works?

9 years ago

Well, apparently your list template includes it with the rest of single post code. Is it Antimatter theme? Where exactly did you paste the buttons code?

9 years ago

Yup, it's the antimatter theme. And, no, I only pasted in blog_item. It goes away completely when I remove from blog_item.

9 years ago

Yeah, but where in the blog_item?

TWIG
        <div class="content-wrapper blog-content-list grid pure-g">
            <div id="listing" class="block pure-u-2-3 h-feed">
                {% for child in collection %}
                    {% include 'partials/blog_item.html.twig' with {'blog':page, 'page':child, 'truncate':true} %}
                {% endfor %}

Yup, blog.html.twig includes the blog_item.html.twig

9 years ago

If you wrap the buttons in condition like this it should help:

TWIG
{% if page.active %} 
# Buttons go here
{% endif %}
👍 1
9 years ago

Always happy to help.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 4 weeks ago
4 470 2 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 799 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 656 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 678 2 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 640 3 months ago