Content objects 

The extension registers the following custom content objects ( HBS_*). They are only useful inside a process-form data processor block; using them elsewhere may log a warning and return an empty string.

Every HBS_* content object supports the standard stdWrap sub-key. The value resolved by the content object is passed through stdWrap before being stored in the processed data array.


HBS_RENDERABLES 

Iterates the child renderables of the current renderable and resolves each one according to per-type configuration. Returns a list (array).

When used at the top level (form runtime as current renderable), it iterates the elements of the current page. For composite renderables such as Fieldset, it iterates their direct children.

Configuration

fields = HBS_RENDERABLES
fields {
    # Per-type configuration (key = EXT:form element type)
    Text {
        template = @form-field-text
        label = HBS_LABEL
        value = HBS_TAG
        value.attribute = value
    }

    # Fallback for types without a dedicated block
    default {
        template = @form-field-generic
    }

    # Single content object for a type (no sub-configuration)
    Honeypot = HBS_PASSTHROUGH

    # Suppress a type entirely
    SomeType {
        if.isTrue = 0
    }
}
Copied!

The lookup order for each child element is: exact type key, default. If neither matches, the element is skipped.

Frontend register

While iterating, HBS_RENDERABLES writes two values to the frontend register that TypoScript conditions can read via register:

  • HBS_RENDERABLES_COUNT – total number of renderables in the current iteration
  • HBS_RENDERABLES_CURRENT – zero-based index of the element being processed (unset after the loop)

HBS_PROPERTY 

Reads a property from the current renderable, its view model, or the form runtime using Extbase\Reflection\ObjectAccess::getProperty(). Returns whatever type the property holds (string, array, object, …).

Configuration

Name Type Default
string (none)
string renderable

path

path
Type
string
Default
(none)

Property path. Supports dotted-path notation for nested access (e.g. renderingOptions.foo).

subject

subject
Type
string
Default
renderable

The object to read from. One of:

  • renderable – the current EXT:form renderable (default)
  • viewModel – the view model built for this renderable
  • formRuntime – the form runtime instance

Example

renderableType = HBS_PROPERTY
renderableType.path = type

# Read from the view model instead
resourcePointerFields = HBS_PROPERTY
resourcePointerFields {
    subject = viewModel
    path = children?[resourcePointerFields?]
}
Copied!

HBS_TAG 

Reads an HTML attribute (or the inner content) from the tag rendered by the current renderable's view model. The view model must implement TagAwareViewModel; this is the case for all view models built by the built-in ViewModelBuilder implementations. Returns a SafeString (Handlebars will not escape the value).

The tag reflects the final output of the Fluid ViewHelper responsible for rendering the renderable. For example, the root FormRuntime object is rendered by the <formvh:form> view helper, so HBS_TAG on it returns attributes (or content) of the <form> tag that view helper produces. Similarly, a Text element is rendered by <f:form.textfield>, so HBS_TAG exposes the attributes of the resulting <input> tag.

Configuration

Name Type Default
string (none)

attribute

attribute
Type
string
Default
(none)

Name of the HTML attribute to read. If omitted, the inner content of the rendered tag is returned instead.

Example

# Read the "id" attribute of the rendered <input> tag
id = HBS_TAG
id.attribute = id

# Read the inner HTML of the rendered tag (e.g. <textarea> content)
content = HBS_TAG
Copied!

HBS_LABEL 

Returns the translated label of the current renderable. If the current view model is a FormFieldViewModel, the label is taken from the view model's pre-resolved label property; otherwise it falls back to $renderable->getLabel(). Returns a string.

Configuration

No configuration keys. stdWrap is supported.

label = HBS_LABEL
Copied!

HBS_FORM_VALUE 

Reads the current or submitted value of the form element. Internally wraps EXT:form's <formvh:renderFormValue> view helper and exposes its result as a FormValueViewModel.

Without an output key the resolved processedValue is returned directly.

Output instructions

The output key accepts one of the following built-in instructions:

Name Type
string instruction
string instruction
string instruction
string instruction
string instruction
string instruction

PROCESSED_VALUE

PROCESSED_VALUE
Type
string instruction

The formatted, human-readable value (e.g. option label for select fields).

VALUE

VALUE
Type
string instruction

The raw, machine-readable value.

IS_MULTI_VALUE

IS_MULTI_VALUE
Type
string instruction

Boolean – whether the field holds multiple values (e.g. multi-select, multi-checkbox).

IS_SECTION

IS_SECTION
Type
string instruction

Boolean – whether the renderable is a section (fieldset, page).

EACH_PROCESSED_VALUE

EACH_PROCESSED_VALUE
Type
string instruction

Iterates over all values and processes each with the sub-configuration in output.

EACH_VALUE

EACH_VALUE
Type
string instruction

Like EACH_PROCESSED_VALUE but uses raw values.

Examples

# Summary page: show the human-readable value
value = HBS_FORM_VALUE
value.output = PROCESSED_VALUE

# Multi-value field: iterate over each option
values = HBS_FORM_VALUE
values {
    output = EACH_PROCESSED_VALUE
    output {
        label = HBS_LABEL

        selected = HBS_PROPERTY
        selected.path = selected
    }
}
Copied!

HBS_NAVIGATION 

Resolves the navigation buttons (previous page, next page / submit) for the current form page. Returns a list of processed items. Each item is built by the sub-configuration keyed by button role.

Button roles

  • previousPage – previous-page button (only present when not on the first page)
  • nextPage – next-page button (only present when not on the last page)
  • submit – submit button (only present on the last page)

Within each role block, HBS_TAG and HBS_LABEL operate on the rendered <button> tag and the translated button label respectively.

Example

navItems = HBS_NAVIGATION
navItems {
    previousPage {
        label = HBS_LABEL

        name = HBS_TAG
        name.attribute = name

        value = HBS_TAG
        value.attribute = value
    }

    nextPage < .previousPage
    submit < .previousPage
}
Copied!

HBS_PASSTHROUGH 

Renders the current renderable using EXT:form's standard Fluid partials and returns the result as a SafeString. Useful for elements that do not need a custom template (e.g. Honeypot, ContentElement) or as a fallback.

Configuration

Additional TypoScript keys are converted to plain PHP variables and passed to the Fluid rendering context:

Honeypot {
    content = HBS_PASSTHROUGH
}

# Pass extra variables to the Fluid partial
SomeElement {
    content = HBS_PASSTHROUGH
    content {
        myVariable = someValue
    }
}
Copied!

HBS_CHILDREN 

Returns the children of the current view model as a list. The view model must implement CompositeViewModel (e.g. ViewModelCollection). Returns null when the view model has no children.

Each child is processed using the sub-configuration of HBS_CHILDREN.

Frontend register

While iterating, HBS_CHILDREN writes two values to the frontend register that TypoScript conditions can read via register:

  • HBS_CHILDREN_COUNT – number of children
  • HBS_CHILDREN_CURRENT – index of the child being processed (unset after the loop)

Example

options = HBS_CHILDREN
options {
    label = HBS_LABEL

    checked = HBS_TAG
    checked.attribute = checked
}
Copied!

HBS_TRANSLATE_PROPERTY 

Translates a renderable property using EXT:form's <formvh:translateElementProperty> view helper.

Configuration

Name Type Default
string (required)
string property

property

property
Type
string
Default
(required)

Name of the element property to translate.

argumentName

argumentName
Type
string
Default
property

Argument name passed to the view helper. Use renderingOptionProperty to translate a rendering option rather than a regular property.

Example

placeholder = HBS_TRANSLATE_PROPERTY
placeholder.property = placeholder

submitButtonLabel = HBS_TRANSLATE_PROPERTY
submitButtonLabel {
    property = submitButtonLabel
    argumentName = renderingOptionProperty
}
Copied!

HBS_TRANSLATE_ERROR 

Returns the translated message for a specific validation error code on the current renderable. Uses EXT:form's <formvh:translateElementError> view helper internally.

Configuration

Name Type Default
int (required)

errorCode

errorCode
Type
int
Default
(required)

Numeric validation error code (e.g. 1221560718 for NotEmpty).

Example

requiredError = HBS_TRANSLATE_ERROR
requiredError.errorCode = 1221560718
Copied!

HBS_VALIDATION_RESULTS 

Returns the Extbase validation results for the current renderable. Without an output instruction the raw Result object is returned.

Output instructions

Name Type
string instruction
string instruction
string instruction
string instruction

EACH_ERROR

EACH_ERROR
Type
string instruction

Iterates over every error and processes each with the sub-configuration in output. On composite renderables the result is a dictionary keyed by property path; on leaf elements it is a flat list.

EACH_RENDERABLE

EACH_RENDERABLE
Type
string instruction

Iterates over renderables that have at least one error. Processes each with the sub-configuration, then passes the result through a second round of process-form resolution so nested HBS_* objects are resolved too. The result is a dictionary keyed by property path.

ERROR_MESSAGE

ERROR_MESSAGE
Type
string instruction

Returns the translated message for the first error in the result set.

RESULT

RESULT
Type
string instruction

Returns a property from the Result object. Requires output.propertyPath to be set.

Example

errors = HBS_VALIDATION_RESULTS
errors {
    output = EACH_RENDERABLE
    output {
        label = HBS_LABEL

        message = HBS_VALIDATION_RESULTS
        message.output = ERROR_MESSAGE
    }
}
Copied!

HBS_VH_CONTENT 

Returns the output of the view helper that was used to build the current view model. The view model must be a ViewHelperContainedViewModel. HTML strings are returned as SafeString (no double-escaping).

No configuration keys beyond stdWrap.

Example

# Render the raw <input> tag produced by the view helper
content = HBS_VH_CONTENT
Copied!