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.

Themes & Styling

Modules with different column-width, Antimatter Theme Inheritance: Dropdownmenu?

Started by sori 8 years ago · 6 replies · 872 views
8 years ago

Hello,
i'm creating a new theme based on Antimatter (Theme-Inheritance).
Now, while exploring and creating modules, I'm running into some problems:

  1. I'd like to create two columns, one of them with half of the width of the other one. Expressed in pure-grid: 8-24 and 16-24.

This code works für 8-24 8-24 8-24 (3 columns):

TWIG
{% block content %}
    <div class="pure-g">
            {% for column in page.content|split('|||') %}
                    <div class="pure-u-md-8-24" style="padding: 0px 25px 0px 25px;">{{ column }}</div>
            {% endfor %}
    </div>
{% endblock %}
</div>

what can I do to make this possible? I tried do implement an if-else construction as seen here: https://stackoverflow.com/questions/7837482/twig-add-first-and-last-class, but it doesn't seem to work.

  1. As I started developing with Theme-Inheritance, there is no Dropdown-Menu findable. Enabling it in the antimatter.yaml configuration file doesn't work. How can I get it back?

Thank you!

8 years ago

Before we go any further, there was a bug only recently fixed with theme inheritance in the devtools plugin. Please read through /forum/general/theme-inheritance-not-working-properly-t7717 and try some of those suggestions.

8 years ago

Hello hughbris,

thank you for your post. I'm not using the devtools plugin and all my plugins, themes and grav itself are currently up-to-date. Theme-Inheritance itself is working without problems. Shall I share my mytheme.yaml, blueprints.yaml and a screenshot from ‘/user/themes/mytheme’ too?

8 years ago

Hello all,

I'd be very happy if somebody could help me with one of my problems.

8 years ago

Your Twig looks to be rendering three equal columns already (in line with this approach), and to make one of them behave differently you can target it with the loop.index variable within the for-loop (see Twig-docs). Basically an if-condition checking where you are in the loop, to use a different class. Eg. {% if loop.index == 2 %}pure-u-md-16-24{% else %}pure-u-md-8-24{% endif %} within the class-attribute.

8 years ago

Hello @OleVik, thank you very much! Works like a charm 🙂
@arank: Thank you, I've tried it already. Sadly, it doesn't work the way I want it to.

Now, does anybody know a solution to my second question?

@sori:
As I started developing with Theme-Inheritance, there is no Dropdown-Menu findable. Enabling it in the antimatter.yaml configuration file doesn’t work. How can I get it back?

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 44 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago