Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Naming conventions & modularity

Koen edited this page Aug 1, 2019 · 3 revisions

Naming field groups

We follow a strict naming convention, depending on where the field group is linked to:

  • Block › <Name>: used for blocks which are cloned in flexible content
  • Page › <Type>: used for groups linked to Front Page or Posts
  • Partial › <Name>: used for partials which are cloned inside other groups
  • Post Type › <Name>: used for post types
  • Option › <Name>: used for (theme) option pages
  • Template › <Name>: used for custom page templates

Structure & modularity

We try to keep our field groups DRY. This means that if there's shared functionality between groups, it's probably better to create a partial for it. This way you can clone it into the groups using the fields, and you only need to update it once.

An example:

If you have a button that's used in multiple groups, it's probably better to create field group called Partial › Button. In it you might have a label, link and style.

You can then add a clone field called button to the groups needing it. This will make all inputs available for usage there. You can access fields in the template in two ways: button.field or button_field


See also:

  • Clone in the ACF documentation