Shared settings

Part of a block's settings does not depend on its type: its name, conditional display, anchor, repetition. In the schema they come from shared fragments that each block type includes. They are described once, here, and the block pages only list what belongs to each block.

FragmentPanel sectionBlocks
Identification blocNameParametersAll 28 blocks
Display displayConditional displayAll 28 blocks
Anchor anchorAnchorAll but the model slot
Repeat repeatParametersAccordion, Carousel, Container
Help tag helperHelp tagButton only
Style cssStyle tabAll 28 blocks — see Styling: CSS cube and Tailwind

Identification

The block name is the only required setting. Unlike the others, it is not stored in properties but in a real field of the table, blockName: it is how you refer to the block from 4D and from JavaScript, for instance to reload it. Make it meaningful and unique within the page.

The id is emitted as is as the id attribute of the HTML element. Use it to target the block from your own CSS or JavaScript.

SettingHow it is setWhat it doesSpecifics
Block name
blockName
text (text)—required
Id (HTML id)
id
text (text)—HTML attribute

Display

Six settings decide whether the block appears, and in what form. They answer different questions and are often confused.

Required access right

A block that carries a required access right is not generated for a visitor who does not hold that right, or who is not logged in. The right is checked again when form data is received: a field protected by a right cannot be saved by someone who lacks it, even if they forged the request themselves.

Conditional display

Conditional display is a 4D formula, evaluated server-side at render time with the page's full context: the current entity, the session, the variables. It can therefore express a real business rule, not just a field comparison. If the formula raises an error, an alert says so and the block is treated as if the condition were false.

When the condition is false, the chosen effect applies:

  • Do nothing: the block displays normally;
  • Disable: the block is rendered, its fields and buttons greyed out;
  • Hide block: the block is rendered, then hidden. Its content is therefore sent to the browser;
  • Not loaded: the block is not generated at all. Nothing reaches the browser.

Hiding is not protecting. A hidden block is in the page, just invisible. For anything that must not reach an unauthorised visitor, use Not loaded or an access right, never hiding.

In edit mode, a hidden or not-loaded block stays visible, flagged with a badge: otherwise you could no longer reach a block hidden by its own rule.

Fields to be filled in

The list of fields to be filled in makes the block depend on other fields of the form, named and separated by |. As long as one of them is empty, the effect applies: the block's fields and buttons are disabled, or the block is hidden. The check runs in the browser whenever a field's value changes: for typed input, when the field is left. Despite its technical name linked, it is not a relation between tables.

Based on listbox selection

This setting appears in the panel, but no code in the component reads it in this version: it has no effect.

SettingHow it is setWhat it doesSpecifics
List of fields to be filled in
linked
textarea (text)—HTML attribute
Effect
effect
checkbox (enum)—default: none, none, disabled, hidden
Required access right
userRightNeeded
select (text)—security check
Based on listbox selection
isBasedOnListboxSelection
toggle (boolean)—default: no
conditional display
conditionalDisplay
text (text)—accepts 4D
Effect if unmet
effectForConditionalDisplay
checkbox (enum)What happens to the block when the condition is false: greyed out, hidden, or not generated at all. In dev mode the block stays visible, flagged with a badge.default: none, none, disabled, hidden, notLoaded

Anchor

An anchor gives the block a landing point in the page. It is emitted as the HTML id, so a #anchor link can lead to it. It accepts a 4D expression.

Anchors mostly feed the anchor menu: a Menu block set up for it lists the page's anchored blocks. Top-level anchors appear sorted by their order; an anchor that declares a parent anchor is listed under it. Both settings only appear once the anchor is filled in.

SettingHow it is setWhat it doesSpecifics
Anchor
data-anchor
text (text)—accepts 4D, HTML attribute
Parent anchor
data-anchorParent
select (text)—HTML attribute
Anchor order
anchorOrder
number (integer)—

Repeat

Repeat renders the block once per item of a collection: it is the page's "for each". It is set on the block that must repeat, in practice a container, and its children follow.

  • The repeat function is a 4D expression returning a collection or an entity selection. Empty parentheses () in it receive the value of the current context.
  • The repeat key name is the name of the variable that receives the current item on each pass. Without a name, it is vv_RepeatData.
  • The iteration id is a 4D expression giving each pass its own identifier. On an entity selection, the primary key already plays that role. On a plain collection without an iteration id, the pass number is used as the key: keep that in mind as soon as the repeated blocks contain fields to save.
  • Do repeat in dev: in edit mode, only the first iteration is rendered by default, to keep the page light. Tick it to see every iteration.

The technical name of that last setting, vb_noRepeatInDev, says the opposite of what it does: ticked, the repeat is rendered in edit mode. Trust the panel label.

Repeating a block repeats its HTML ids too. If you write JavaScript inside a repeated block, do not target an element by a bare id: the click would always act on the first iteration.

SettingHow it is setWhat it doesSpecifics
Repeat
vb_Repeat
toggle (boolean)—default: no
Repeat function
vt_RepeatFunctionToExecute
text (text)—accepts 4D
Repeat key name
vt_RepeatKeyname
text (text)—
Iteration id
vt_RepeatIdIteration
text (text)—accepts 4D
Do repeat in dev
vb_noRepeatInDev
toggle (boolean)—default: no

Help tag

Specific to the button: a guided intro text (translatable) and its step number. They feed the page's guided tour (intro.js library), which starts when a link whose address contains help is clicked.

SettingHow it is setWhat it doesSpecifics
Guided intro
vt_Intro
text (text)—translatable
Intro step
vl_IntroStep
number (integer)—

Style

All 28 blocks also include styling. The targets (the parts of a block that can be styled) are specific to each type and listed on each block page. How it works is shared: it is described in Styling: CSS cube and Tailwind.

The tables on this page are produced automatically from the block's schema. If this page and the panel disagree, the schema is right.