Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Turning off the sidebar

first-time theme

Solved by Leonardo View solution

Started by Leonardo 1 year ago · 4 replies · 88 views
1 year ago

Hi peeps, please forgive my rookie question, this is my first time here-- I'm starting my blog from a barebones blank theme with the blog components copied from the Antimatter theme. I don't have a use for the sidebar included in Block Content on base.html.twig (see below). I see sidebar.html.twig as its content, but what I need is to turn off the sidebar altogether from its parent container. I'm failing to connect the dots between those two. Any ideas? Thanks.

TWIG
{% block body %}
    <section id="body">
        <div class="wrapper padding">
        {% block content %}{% endblock %}
        </div>
    </section>
{% endblock %}
1 year ago

Update: I commented or deleted the<div id="sidebar" class="block size-1-3 pure-u-1-3"> section on blog.html.twig, to no avail. [Scratches head]

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 %}

                {% if config.plugins.pagination.enabled and collection.params.pagination %}
                    {% include 'partials/pagination.html.twig' with {'base_url':page.url, 'pagination':collection.params.pagination} %}
                {% endif %}
            </div>
            {# <div id="sidebar" class="block size-1-3 pure-u-1-3">
                {% include 'partials/sidebar.html.twig' with {'blog':page} %}
            </div> #}
        </div>
    {% endblock %}
1 year ago

Sigh, I must have edited that away because I don't see {% block sidebar_navigation %} anywhere, or likely not copied from Antimatter. So I have no idea where the Sidebar is coming from.

To clarify, my theme is a pure blank with Antimatter Blog components copied, as instructed here.

last edited 01/29/25 by Leonardo
1 year ago Solution

Solved it, in part. I was being silly, it was right there on line 30 on templates/blog.html.twig. Don't ask me why it was there instead of base.html.twig. 😅

TWIG
{% embed 'partials/base.html.twig' %}

[...]

            </div>
            {# <div id="sidebar" class="block size-1-3 pure-u-1-3">
                {% include 'partials/sidebar.html.twig' with {'blog':page} %}
            </div> #}
        </div>
    {% endblock %}
👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago