Quick Facts

This special Hublify-object represents a content-blocks-array that can be easily rendered.

  • Supports multi-level "theming" / template-selection.
  • Supports evaluation of content block's active-state.
  • Supports evaluation of content block's optional publish-start- and -end-time.


Functions

setContentBlocks(...)

Sets the actual content blocks to render.

Syntax:

setContentBlocks(?array $contentBlocks): hublify_var_ext_contentblocks


setData(...)

Sets additional data. This data is passed into each sub-render process for the single content blocks, as a twig variable "data".

Syntax:

setData($data): hublify_var_ext_contentblocks


setPublishTime(...)

Changes the internal "render publish time".

Syntax:

setPublishTime(?string $datetime): hublify_var_ext_contentblocks


themes(...)

Sets one or more template-themes to be used for rendering for this content block object.
Per default the themes defined within the render-env are used.

Syntax:

themes(?array $themes): hublify_var_ext_contentblocks


params(...)

Wrapping function to set multiple configuration at once with one array.

Syntax:

params(?array $params): hublify_var_ext_contentblocks


render(...)

Renders the content blocks and returns the (html-) result string.

This function also called, when a content block object is printed within twig.

Syntax:

render(): string

Examples


// #1
{{ hublify.contentblocks(...) }}


// #2
{% set prdD = hublify.dataset('product').fields(['pcode','name','hfycblks_shopdetail']).filter('pcode','00000006').one() %} 
{{ hublify.contentblocks(prdD.hfycblks_shopdetail.data).render() }}