Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grid view from custom sidebar navigation menu #953

Closed
MaCXyLo opened this issue Apr 16, 2017 · 2 comments
Closed

grid view from custom sidebar navigation menu #953

MaCXyLo opened this issue Apr 16, 2017 · 2 comments

Comments

@MaCXyLo
Copy link

MaCXyLo commented Apr 16, 2017

Hi,
i want to create a grid view from the links of a custom sidebar navigation menu.
the links at the custom sidebar navigation menu have overlay_images.
Found this piece of code.

<div class="grid__wrapper">
  {% for post in pages.category.product %}
    {% include archive-single.html type="grid" %}
  {% endfor %}
</div>

I created a products folder in the _pages folder and created several markdown files.
have not the right idea at the moment to do that.
Can anybody help?

Kind Regards,

@mmistakes
Copy link
Owner

The archive single include has a type flag on it. If you call it with {% include archive-single.html type="grid" %} it'll output the HTML needed for a grid element.

You'll also need to wrap it with a for loop that has a post object... similar to the example above. If you look at the _includes/archive-single.html you'll get a better idea of what actual YAML variables it uses.

The grid images are assigned with header.teaser and not the overlay images. You can see an example here which is used to build the "related posts" module at the bottom of a post.

screen shot 2017-04-16 at 9 26 05 pm

@mmistakes
Copy link
Owner

Feel free to reopen if you're still having trouble and can provide additional info or a link to a public repo to better assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants