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

[typhoon] Modular Page containing Blog + Gallery #323

Closed
mfuggle opened this issue Nov 23, 2022 · 7 comments
Closed

[typhoon] Modular Page containing Blog + Gallery #323

mfuggle opened this issue Nov 23, 2022 · 7 comments
Assignees
Labels
typhoon Typhoon theme

Comments

@mfuggle
Copy link

mfuggle commented Nov 23, 2022

Hi Folks,
I am a Grav Newbie but spending a lot of time learning. I am using the Typhoon Blog skeleton and want to be able to display a Gallery immediately below the Blog. I think I need to create a Modular page and include type Blog and Type Gallery. However when I create a Modular Page I am not able to see type Blog to add to the page.
I am probably failing to explain myself well but that's because I haven't yet managed fully understand Grav as well as the Typhoon theme.
I just need to be pointed in the right direction because I am floundering right now.
Regards
Martin Fuggle

P.S. I have also posted this on the Typhoon github. Where should I post Grav Typhoon issues/questions?

@mfuggle
Copy link
Author

mfuggle commented Nov 25, 2022

Anyone going to respond?

@rhukster
Copy link
Member

I will respond after the thanksgiving holidays.

@mfuggle
Copy link
Author

mfuggle commented Nov 26, 2022

Many thanks...
I want to display a gallery at the bottom of a blog post. My folder structure is:
Pages Folder

Pages Folder

and my gallery.md, post.md and blog.md are shown below:

gallery md
post md
blog md

I have removed as much as possible from the .md files to simplify things. My issue is that the Blog displays with its child posts but the child post does not display the gallery. I have tried to track this down but have failed. If someone could point me in the right direction I would be most grateful.
Cheers
Martin Fuggle

@mfuggle
Copy link
Author

mfuggle commented Nov 29, 2022

Has Thanksgiving finished yet? It would be really helpful to get some assistance after 7 days.

@rhukster
Copy link
Member

yes, it's finished :)

the problem is that the post page doesn't know it should do anything with the gallery modular sub-page.

I see you have attempted to create a collection in post.md but the syntax is incorrect, it should be:

post.md:

content:
  items: self@.modular

Then the post.html.twig template needs to be modified to display any pages from the modular collection below the post:

post.html.twig:

...
{% block items %}
    ...

    {% for module in page.collection() %}
    {{ module.content|raw }}
    {% endfor %}
{% endblock %}

{% block sidebar %}
    {% include 'partials/sidebar.html.twig' %}
{% endblock %}
...

That should do it.

@rhukster rhukster added the typhoon Typhoon theme label Nov 29, 2022
@rhukster rhukster changed the title [Typhoon] Modular Page containing Blog + Gallery [typhoon] Modular Page containing Blog + Gallery Nov 29, 2022
@rhukster rhukster self-assigned this Nov 29, 2022
@mfuggle
Copy link
Author

mfuggle commented Nov 30, 2022 via email

@rhukster
Copy link
Member

rhukster commented Dec 5, 2022

👍🏻

@rhukster rhukster closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typhoon Typhoon theme
Projects
None yet
Development

No branches or pull requests

2 participants