Applied on all three render paths: stdWrap.if rule on lib.contentElementWithHeader (before the plugin copies), the same rule in the container element definitions, and a HiddenHeaderProcessor behind the nb content-blocks data processor. headerLayout itself stays in the payload so the front end can tell why the header is empty.
178 lines
6.8 KiB
Plaintext
Executable File
178 lines
6.8 KiB
Plaintext
Executable File
# =============================================================================
|
||
# VITEC container content elements — self-contained JSON rendering
|
||
# Children collected via Evomedien\Vitec\DataProcessing\ContainerChildrenProcessor
|
||
# (exception-safe; returns [] on any error, never crashes the outer CE).
|
||
#
|
||
# Per-column flex settings (align/justify) live on the PARENT record
|
||
# (tx_vitec_col{1..4}_align/justify) and are attached by the processor to each
|
||
# column in `items` (items[].config.align/justify) — so they apply to ALL
|
||
# children of that column. The whole-grid gap (tx_vitec_gap) is emitted here as
|
||
# the parent-level `gap`.
|
||
# =============================================================================
|
||
|
||
tt_content.vitec_cols_50_50 = JSON
|
||
tt_content.vitec_cols_50_50 {
|
||
fields {
|
||
id = INT
|
||
id.field = uid
|
||
type = TEXT
|
||
type.field = CType
|
||
colPos = INT
|
||
colPos.field = colPos
|
||
|
||
categories = COA
|
||
categories {
|
||
10 = CONTENT
|
||
10 {
|
||
table = sys_category
|
||
select {
|
||
pidInList = root
|
||
selectFields = sys_category.title
|
||
join = sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid
|
||
where {
|
||
field = uid
|
||
wrap = AND sys_category_record_mm.tablenames = 'tt_content' AND sys_category_record_mm.uid_foreign=|
|
||
}
|
||
}
|
||
renderObj = TEXT
|
||
renderObj {
|
||
field = title
|
||
wrap = |###BREAK###
|
||
}
|
||
}
|
||
stdWrap.split {
|
||
token = ###BREAK###
|
||
cObjNum = 1 |*|2|*| 3
|
||
1 {
|
||
current = 1
|
||
stdWrap.wrap = |
|
||
}
|
||
2 {
|
||
current = 1
|
||
stdWrap.wrap = ,|
|
||
}
|
||
3 {
|
||
current = 1
|
||
stdWrap.wrap = |
|
||
}
|
||
}
|
||
}
|
||
|
||
appearance = JSON
|
||
appearance {
|
||
fields {
|
||
layout = TEXT
|
||
layout.field = layout
|
||
frameClass = TEXT
|
||
frameClass.field = frame_class
|
||
spaceBefore = TEXT
|
||
spaceBefore.field = space_before_class
|
||
spaceAfter = TEXT
|
||
spaceAfter.field = space_after_class
|
||
}
|
||
}
|
||
|
||
# header_layout 100 = "Hidden": header, subheader and headerLink stay
|
||
# out of the JSON (same rule as lib.contentElementWithHeader).
|
||
header = TEXT
|
||
header.field = header
|
||
header.stdWrap.if {
|
||
value = 100
|
||
equals.field = header_layout
|
||
negate = 1
|
||
}
|
||
subheader = TEXT
|
||
subheader.field = subheader
|
||
subheader.stdWrap.if {
|
||
value = 100
|
||
equals.field = header_layout
|
||
negate = 1
|
||
}
|
||
headerLayout = INT
|
||
headerLayout.field = header_layout
|
||
headerPosition = TEXT
|
||
headerPosition.field = header_position
|
||
headerLink = TEXT
|
||
headerLink {
|
||
htmlSpecialChars = 1
|
||
typolink {
|
||
parameter.field = header_link
|
||
returnLast = result
|
||
}
|
||
stdWrap.if {
|
||
value = 100
|
||
equals.field = header_layout
|
||
negate = 1
|
||
}
|
||
}
|
||
tx_vitec_bg_variant = TEXT
|
||
tx_vitec_bg_variant.field = tx_vitec_bg_variant
|
||
|
||
# Parent-level: column gap scale (1–5) for the whole grid.
|
||
gap = TEXT
|
||
gap.field = tx_vitec_gap
|
||
|
||
# Columns with their children + per-column flex (align/justify) in
|
||
# items[].config — assembled by ContainerChildrenProcessor.
|
||
items = JSON
|
||
items {
|
||
dataProcessing {
|
||
10 = Evomedien\Vitec\DataProcessing\ContainerChildrenProcessor
|
||
10.as = items
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
tt_content.vitec_cols_33_33_33 < tt_content.vitec_cols_50_50
|
||
tt_content.vitec_cols_25_25_25_25 < tt_content.vitec_cols_50_50
|
||
tt_content.vitec_cols_66_33 < tt_content.vitec_cols_50_50
|
||
tt_content.vitec_cols_33_66 < tt_content.vitec_cols_50_50
|
||
|
||
# -----------------------------------------------------------------------------
|
||
# VITEC · Container — single-column container with a custom CSS class.
|
||
# Inherits the full structure of the grid containers and adds the `cssClass`
|
||
# field, read from the element's FlexForm (settings.cssClass).
|
||
# Single column -> no grid gap.
|
||
# -----------------------------------------------------------------------------
|
||
tt_content.vitec_container < tt_content.vitec_cols_50_50
|
||
tt_content.vitec_container.fields.gap >
|
||
tt_content.vitec_container.fields.cssClass = TEXT
|
||
tt_content.vitec_container.fields.cssClass.data = flexform:pi_flexform:settings.cssClass
|
||
tt_content.vitec_container.fields.cssClass.stdWrap.ifEmpty.cObject = TEXT
|
||
tt_content.vitec_container.fields.cssClass.stdWrap.ifEmpty.cObject.value =
|
||
|
||
# Optional background image with its two CSS settings. The renderer returns an
|
||
# empty string when no image is set, so the `background` key stays out of the
|
||
# payload entirely rather than appearing with a null image.
|
||
tt_content.vitec_container.fields.background = USER
|
||
tt_content.vitec_container.fields.background.userFunc = Evomedien\Vitec\UserFunc\ContainerBackgroundRenderer->render
|
||
|
||
# -----------------------------------------------------------------------------
|
||
# VITEC · Cards Carousel — container whose children (typically vitec_card
|
||
# elements) become the slides. Inherits the grid-container JSON structure
|
||
# (`items` via ContainerChildrenProcessor) and adds carousel settings read
|
||
# from the element's FlexForm. Single slide track -> no grid gap.
|
||
# -----------------------------------------------------------------------------
|
||
tt_content.vitec_cards_carousel < tt_content.vitec_cols_50_50
|
||
tt_content.vitec_cards_carousel.fields.gap >
|
||
tt_content.vitec_cards_carousel.fields.carousel = JSON
|
||
tt_content.vitec_cards_carousel.fields.carousel {
|
||
fields {
|
||
slidesPerView = TEXT
|
||
slidesPerView.data = flexform:pi_flexform:settings.slidesperview
|
||
showArrows = TEXT
|
||
showArrows.data = flexform:pi_flexform:settings.showarrows
|
||
showIndicators = TEXT
|
||
showIndicators.data = flexform:pi_flexform:settings.showindicators
|
||
loop = TEXT
|
||
loop.data = flexform:pi_flexform:settings.loop
|
||
autoplay = TEXT
|
||
autoplay.data = flexform:pi_flexform:settings.autoplay
|
||
autoplayInterval = TEXT
|
||
autoplayInterval.data = flexform:pi_flexform:settings.autoplayinterval
|
||
}
|
||
}
|
||
tt_content.vitec_cards_carousel.fields.cssClass = TEXT
|
||
tt_content.vitec_cards_carousel.fields.cssClass.data = flexform:pi_flexform:settings.cssClass
|