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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Custom Modular Menu Disappears

Started by Donald J. Trump 8 years ago · 3 replies · 445 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 Jerry Hunt, 4 days ago
2 99 16 hours ago
General · by pamtbaau, 21 hours ago
1 63 21 hours ago
General · by Andy Miller, 1 day ago
0 48 1 day ago
General · by Marcel, 12 months ago
6 357 5 days ago
General · by Duc , 6 days ago
3 45 6 days ago