.. include:: /Includes.rst.txt .. _content-objects: ================ Content objects ================ The extension registers the following custom content objects (:typoscript:`HBS_*`). They are only useful inside a :typoscript:`process-form` data processor block; using them elsewhere may log a warning and return an empty string. Every :typoscript:`HBS_*` content object supports the standard :ref:`stdWrap ` sub-key. The value resolved by the content object is passed through :typoscript:`stdWrap` before being stored in the processed data array. ---- .. contents:: :local: .. _co-hbs-renderables: 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 :typoscript:`Fieldset`, it iterates their direct children. **Configuration** .. code-block:: typoscript 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, :typoscript:`default`. If neither matches, the element is skipped. **Frontend register** While iterating, :typoscript:`HBS_RENDERABLES` writes two values to the frontend register that TypoScript conditions can read via :ref:`register `: - :typoscript:`HBS_RENDERABLES_COUNT` – total number of renderables in the current iteration - :typoscript:`HBS_RENDERABLES_CURRENT` – zero-based index of the element being processed (unset after the loop) .. note:: Since TYPO3 v14 the register is part of the frontend register stack on the global request object (:php:`frontend.register.stack` request attribute) rather than the legacy :php:`$GLOBALS['TSFE']->register` array. The extension handles both automatically. .. _co-hbs-property: HBS\_PROPERTY ============= Reads a property from the current renderable, its view model, or the form runtime using :php:`Extbase\Reflection\ObjectAccess::getProperty()`. Returns whatever type the property holds (string, array, object, …). **Configuration** .. confval-menu:: :name: hbs-property :display: table :type: :default: .. confval:: path :name: hbs-property-path :type: string :default: *(none)* Property path. Supports dotted-path notation for nested access (e.g. :typoscript:`renderingOptions.foo`). .. confval:: subject :name: hbs-property-subject :type: string :default: :typoscript:`renderable` The object to read from. One of: - :typoscript:`renderable` – the current EXT:form renderable (default) - :typoscript:`viewModel` – the view model built for this renderable - :typoscript:`formRuntime` – the form runtime instance **Example** .. code-block:: typoscript renderableType = HBS_PROPERTY renderableType.path = type # Read from the view model instead resourcePointerFields = HBS_PROPERTY resourcePointerFields { subject = viewModel path = children?[resourcePointerFields?] } .. _co-hbs-tag: 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 :php:`TagAwareViewModel`; this is the case for all view models built by the built-in :php:`ViewModelBuilder` implementations. Returns a :php:`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 :php:`FormRuntime` object is rendered by the :fluid:`` view helper, so :typoscript:`HBS_TAG` on it returns attributes (or content) of the :html:`
` tag that view helper produces. Similarly, a :typoscript:`Text` element is rendered by :fluid:``, so :typoscript:`HBS_TAG` exposes the attributes of the resulting :html:`` tag. **Configuration** .. confval-menu:: :name: hbs-tag :display: table :type: :default: .. confval:: attribute :name: hbs-tag-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** .. code-block:: typoscript # Read the "id" attribute of the rendered tag id = HBS_TAG id.attribute = id # Read the inner HTML of the rendered tag (e.g.