Jump to content

Field layout in module config


Recommended Posts

I'm sure there's an easy answer that I overlooked in the docs or failed to find in the forum, but...

If you look at the attached screenshot, my module config has 2 simple checkbox fields, and I would like to get them to be side by side, 50% width each. How can I do that?

Apologies if whatever I missed is really obvious!

Here's my module config file.

<?php
namespace ProcessWire;

$config = [
    'rateLimiterActive' => [
        'type' => 'checkbox',
        'label' => 'Rate Limiter',
        'description' => 'Activate the ZpTraffic rate limiter on this site',
        'value' => '0',
    ],
    'blockEmptyAgents' => [
        'type' => 'checkbox',
        'label' => 'Block Empty Agents',
        'description' => 'Block visits with an empty user agent string (send a 400 Bad Request)',
        'value' => '0',
    ],
];

Screenshot 2024-10-08 at 14.37.13.png

Edited by DrewPH
Added PHP code
Link to comment
Share on other sites

@Ivan Gretsky Thanks, that works! I came across the columnWidth attribute at some point but then lost where I had seen it.

@bernhard Thanks for the link. For commercial sites I'd probably install that - however this is my "learn how to build a module" module 😀

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...