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

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):

{% 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!

Before we go any further, there was a bug only recently fixed with theme inheritance in the devtools plugin. Please read through Theme inheritance Not Working Properly and try some of those suggestions.

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?

Hello all,

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

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.

You can use the section shortcode from grav-plugin-shortcode-core

Hello @OleVik, thank you very much! Works like a charm :slight_smile:
@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?