Content objects
The extension registers the following custom content objects (
HBS_*). They
are only useful inside a
process- 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
std
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
}
}
The lookup order for each child element is: exact type key,
default. If
neither matches, the element is skipped.
Frontend register
While iterating,
HBS_ writes two values to the frontend
register that TypoScript conditions can read via register:
HBS_– total number of renderables in the current iterationRENDERABLES_ COUNT HBS_– zero-based index of the element being processed (unset after the loop)RENDERABLES_ CURRENT
Note
Since TYPO3 v14 the register is part of the frontend register stack on the global
request object (
frontend. request attribute) rather than the
legacy
$GLOBALS array. The extension handles both automatically.
HBS_PROPERTY
Reads a property from the current renderable, its view model, or the form runtime
using
Extbase\. Returns whatever type the
property holds (string, array, object, …).
Configuration
path
-
- Type
- string
- Default
- (none)
Property path. Supports dotted-path notation for nested access (e.g.
rendering).Options. foo
subject
-
- Type
- string
- Default
renderable
The object to read from. One of:
renderable– the current EXT:form renderable (default)view– the view model built for this renderableModel form– the form runtime instanceRuntime
Example
renderableType = HBS_PROPERTY
renderableType.path = type
# Read from the view model instead
resourcePointerFields = HBS_PROPERTY
resourcePointerFields {
subject = viewModel
path = children?[resourcePointerFields?]
}
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
Tag; this is
the case for all view models built by the built-in
View implementations.
Returns a
Safe (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
Form object is rendered by the
<formvh: view helper, so
HBS_ on it returns attributes (or
content) of the
<form> tag that view helper produces. Similarly, a
Text
element is rendered by
<f:, so
HBS_ exposes the
attributes of the resulting
<input> tag.
Configuration
| Name | Type | Default |
|---|---|---|
| string | (none) |
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
HBS_LABEL
Returns the translated label of the current renderable. If the current view model is
a
Form, the label is taken from the view model's pre-resolved
label property; otherwise it falls back to
$renderable->get.
Returns a string.
Configuration
No configuration keys.
std is supported.
label = HBS_LABEL
HBS_FORM_VALUE
Reads the current or submitted value of the form element. Internally wraps
EXT:form's
<formvh: view helper and exposes its result
as a
Form.
Without an
output key the resolved
processed 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
-
- Type
- string instruction
The formatted, human-readable value (e.g. option label for select fields).
VALUE
-
- Type
- string instruction
The raw, machine-readable value.
IS_MULTI_VALUE
-
- Type
- string instruction
Boolean – whether the field holds multiple values (e.g. multi-select, multi-checkbox).
IS_SECTION
-
- Type
- string instruction
Boolean – whether the renderable is a section (fieldset, page).
EACH_PROCESSED_VALUE
-
- Type
- string instruction
Iterates over all values and processes each with the sub-configuration in
output.
EACH_VALUE
-
- Type
- string instruction
Like
EACH_but uses raw values.PROCESSED_ VALUE
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
}
}
HBS_PASSTHROUGH
Renders the current renderable using EXT:form's standard Fluid partials and returns
the result as a
Safe. Useful for elements that do not need a custom template
(e.g.
Honeypot,
Content) 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
}
}
HBS_CHILDREN
Returns the children of the current view model as a list. The view model must implement
Composite (e.g.
View). Returns
null when the
view model has no children.
Each child is processed using the sub-configuration of
HBS_.
Frontend register
While iterating,
HBS_ writes two values to the frontend register
that TypoScript conditions can read via register:
HBS_– number of childrenCHILDREN_ COUNT HBS_– index of the child being processed (unset after the loop)CHILDREN_ CURRENT
Note
Since TYPO3 v14 the register is part of the frontend register stack on the global
request object (
frontend. request attribute) rather than the
legacy
$GLOBALS array. The extension handles both automatically.
Example
options = HBS_CHILDREN
options {
label = HBS_LABEL
checked = HBS_TAG
checked.attribute = checked
}
HBS_TRANSLATE_PROPERTY
Translates a renderable property using EXT:form's
<formvh:
view helper.
Configuration
| Name | Type | Default |
|---|---|---|
| string | (required) | |
| string |
property
|
property
-
- Type
- string
- Default
- (required)
Name of the element property to translate.
argumentName
-
- Type
- string
- Default
property
Argument name passed to the view helper. Use
renderingto translate a rendering option rather than a regular property.Option Property
Example
placeholder = HBS_TRANSLATE_PROPERTY
placeholder.property = placeholder
submitButtonLabel = HBS_TRANSLATE_PROPERTY
submitButtonLabel {
property = submitButtonLabel
argumentName = renderingOptionProperty
}
HBS_TRANSLATE_ERROR
Returns the translated message for a specific validation error code on the current
renderable. Uses EXT:form's
<formvh: view helper internally.
Configuration
| Name | Type | Default |
|---|---|---|
| int | (required) |
errorCode
-
- Type
- int
- Default
- (required)
Numeric validation error code (e.g.
1221560718forNot).Empty
Example
requiredError = HBS_TRANSLATE_ERROR
requiredError.errorCode = 1221560718
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
-
- 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
-
- 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-resolution so nestedform HBS_*objects are resolved too. The result is a dictionary keyed by property path.
ERROR_MESSAGE
-
- Type
- string instruction
Returns the translated message for the first error in the result set.
RESULT
-
- Type
- string instruction
Returns a property from the
Resultobject. Requiresoutput.to be set.property Path
Example
errors = HBS_VALIDATION_RESULTS
errors {
output = EACH_RENDERABLE
output {
label = HBS_LABEL
message = HBS_VALIDATION_RESULTS
message.output = ERROR_MESSAGE
}
}
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
View. HTML strings are
returned as
Safe (no double-escaping).
No configuration keys beyond
std.
Example
# Render the raw <input> tag produced by the view helper
content = HBS_VH_CONTENT