ForjaCustom fields, defined in code
CMB2's developer API with ACF's editing experience. No admin panel, no plugin to activate.
CMB2's developer API with ACF's editing experience. No admin panel, no plugin to activate.
add_action( 'forja/register_boxes', function () {
forja_register_box( 'home', array(
'title' => 'Home content',
'object_subtypes' => array( 'page' ),
'fields' => array(
array( 'type' => 'text', 'name' => 'headline', 'label' => 'Headline' ),
array( 'type' => 'image', 'name' => 'background', 'label' => 'Background image' ),
),
) );
} );And in your template:
forja_the_field( 'headline' );
$background = forja_get_field( 'background' );field_0_subfield, dates as Ymd. An existing site reads without migrating anything.Grouped by what they're for. The full reference — every option, what each one stores and what it returns — lives in The fields.
| Family | Types |
|---|---|
| Text and numbers | text textarea number range email url password |
| Choice | select radio checkbox button_group true_false |
| Rich content | wysiwyg link oembed |
| Media | image file gallery icon_picker |
| Date, time and colour | date_picker time_picker date_time_picker color_picker |
| Relational | post_object page_link relationship taxonomy user |
| Composite | repeater group flexible_content |
| Presentation | message separator tab accordion |
Four worth calling out:
repeater and flexible_content store in ACF's format — banner_0_title, one key per sub-field and row — so an existing site reads without migrating.icon_picker searches Iconify's 200,000+ icons live. No catalogue is bundled, and the front end gets an inline SVG with no JavaScript.clone isn't a type in the registry: it's resolved when the group is declared, so nothing downstream ever sees it. It pulls a reusable field set into as many groups as you like, with optional prefixes and per-field overrides.Every type works inside a repeater row, including wysiwyg and the relational ones.
Documentation in Spanish
This project is written in Spanish, and so is most of its documentation. The pages translated here cover installation and the field reference — enough to decide whether Forja fits your project and to get the first group of fields working.
The Spanish site covers everything: repeaters, flexible content, clone, conditional logic, the relational fields and the architecture notes. When the two versions disagree, Spanish is the canonical one.