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

Landing on Learn2 theme

Started by Muut Archive 11 years ago · 2 replies · 288 views
11 years ago

I have a simple question since I'm still very new to this Grav. Simply put I want to put a home page of the Learn2 theme to have a landing on it first.

How hard is it to do one, either using another theme with landing (Woo) or making one by myself?

11 years ago

Hi, each theme can choose to implement various "page templates". Learn2 implements mainly chapter and docs, because it's a documentation theme.

You need to add a "default" page template, by adding a default.html.twig file with this content:

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

{% block content %}
    {{ page.content }}
{% endblock %}

Then you can create a page with the default page template, and you can set that page to be the home page.

BTW the learn2 theme is structured to always show the sidebar, so if you want to hide it on the home, you might need to modify the theme accordingly, perhaps editing its templates/partials/base.html.twig file and add a {% if page.template != 'default' %},{% endif %} around the sidebar inclusion line

11 years ago

Hey, thanks for the reply! I will try out this when I can. I will post here if I need more help with this.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1333 9 years ago
Archive · by Muut Archive, 9 years ago
2 924 9 years ago
Archive · by Muut Archive, 9 years ago
2 4055 9 years ago
Archive · by Muut Archive, 9 years ago
1 2935 9 years ago
Archive · by Muut Archive, 9 years ago
3 1111 9 years ago