Jump to content

Recommended Posts

Posted

Nested Checkboxes

An inputfield for Page Reference fields that groups options by their parent page, and optionally by grandparent page too.

This can help editors understand the grouping of the selectable pages, and also makes it quicker for an editor to select or unselect an entire group of pages.

Screen recording

The checkboxes at the parent and grandparent level are not for storing those pages in the field value - only for quickly selecting or unselecting groups of pages at the lowest level of the hierarchy. For example, in the screen recording above the "Cities" Page Reference field allows only pages with the "city" template, and the pages at the country and continent level are not included in the field value.

The inputfield is only for use with Page Reference fields because the structure comes from the page tree.

Requires PW >= v3.0.248.

Configuration

For each field that uses the inputfield you have these options:

  • Checkboxes structure: choose "Parents" or "Parents and grandparents".
  • Collapse sections that contain no checked checkboxes: this option makes the inputfield more compact.
  • There are also the standard column width and column quantity options familiar from the InputfieldCheckboxes inputfield. These apply to the selectable pages at the lowest level of the hierarchy, and the structure is arguably more readable when these are left at their defaults.

 

https://github.com/Toutouwai/InputfieldNestedCheckboxes
https://processwire.com/modules/inputfield-nested-checkboxes/

  • Like 19
  • Thanks 4
  • 3 weeks later...
Posted

Amazing! Thanks for open-sourcing 🙂

My main use case for this would be a nested page tree of categories. So a single template, but nested one or two levels deep, and both parents and children can be selected. Is this currently supported?

 

Posted
2 hours ago, d'Hinnisdaël said:

Amazing! Thanks for open-sourcing 🙂

Thanks!

2 hours ago, d'Hinnisdaël said:

My main use case for this would be a nested page tree of categories. So a single template, but nested one or two levels deep, and both parents and children can be selected. Is this currently supported?

Sorry, no, the exclusion of the grandparents and parents from the Page Reference field value is baked in. What you're describing would need to be handled by a different module.

Posted
8 hours ago, Robin S said:

Sorry, no, the exclusion of the grandparents and parents from the Page Reference field value is baked in. What you're describing would need to be handled by a different module.

Good to know. Makes sense to keep it simple 🙂

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
×
×
  • Create New...