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

Is there a bug in the antimatter blog.html.twig file?

Started by Muut Archive 10 years ago · 4 replies · 535 views
10 years ago

I have the latest version of antimatter and see that the page.content is being rendered in the .blog-header div. The result is that the content of the blog post takes up full width which makes the right sidebar with the search form appear below the content.

A bit further down there is the .content-wrapper div where the the 2-3 #listing and 1-3 #sidebar columns are, but the only thing in the 2-3 #listing column appears to be a blog roll.

Is this a bug in the blog page template? Should the page.content section be inside the #listing column?

Here's a cutdown version of the blog.html.twig code that shows the issue.

I'm so new to Grav that I want to check on this before just making a change in the file.

TWIG

{% block content %}
   <div class="blog-header">
      {{ page.content }}
   </div>

   <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} %}
               {% e ndfor %}
      </div>
      <div id="sidebar" class="block size-1-3 pure-u-1-3">
         {% include 'partials/sidebar.html.twig' with {'blog':page} %}
      </div>
   </div>
{% endblock %}
---
10 years ago

the actual content of the blog.md is not the content of the blog, just a header under which all blog posts (for child in collection) are listed, so yes, this is correct.
The idea is that it's some sort of header, like "this is scotsscripts' fantastic blog bla bla"

10 years ago

Ah, I get it now. The blog posts must be under a parent page that is also a blog template. You can't mix blog templates with other pages and expect them to work.

10 years ago

not sure what you mean. it's a folder structure, for me it is user/pages/blog/.
this directory contains the file blog.md and lots of subfolders.
each subfolder is an article, and contains at least a file called item.md
(just an example though). each .md file must have a corresponding twig template in the theme, e.g. item.md => item.html.twig

10 years ago

I mean, to have the blog template display correctly, it must be in a folder tree that starts with a blog page template. I was mixing and matching various page templates under a drop-down nav item without realizing how the relationships worked.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago