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

Custom Modular Menu Disappears

Started by Donald J. Trump 8 years ago · 3 replies · 510 views
8 years ago

I've created a custom template called "columns.html.twig" in the "quark/templates/modular" folder but when I try to create a new modular with this template active my menu disappears.

image|690x296

The code contained is:

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

{% block content %}
    <table>
        <tr>
            {% for column in page.content|split('<hr />') %}
            <td>{{ column }}</td>
            {% endfor %}
        </tr>
    </table>
{% endblock %}
8 years ago

First of all, look in your browser in the developer menu [cmd+alt+i], what is happening in this block. Perhaps just the background has become white and you do not see the white text. Then it seems to me that you are not using the modular pages principle quite correctly. To create a module, you do not need to extend the base template and specify a block ({% extends 'partials/base.html.twig' %} {% block content %}) Simply code from <table> and place the file in the modular folder.
Regards

last edited 11/22/18 by Sergey Serebrennikov
8 years ago

If I code from <table> then my columns don't obey css border rules, it spans all the way from one side of the page to the other.

8 years ago

I'm not sure I understand. But usually, to define the style of an element, we assign it a class and define the style of that class.
<table class="features-table">...</table>
<style>
.features-table {
border: 2px solid grey;
}
</style>

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 3 weeks ago
1 268 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 196 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 332 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 226 3 weeks ago