Showing, hiding, enabling

These properties all come from the shared display fragment, so every block that includes it has them. They answer different questions and are often confused.

PropertyQuestion it answers
effectWhat happens to this block by default: nothing, disabled, hidden
conditionalDisplayA 4D formula, evaluated server-side
effectForConditionalDisplayWhat happens when that formula is false
userRightNeededWhich right the visitor must hold
linkedWhich other fields must be filled before this one is usable
isBasedOnListboxSelectionWhether the block depends on a listbox having a selection

conditionalDisplay runs on the server

It is a 4D formula run through EXECUTE FORMULA at render time, with the page's full context — the entity, the session, the process variables. Two consequences:

  • it can express real business rules, not just field comparisons;
  • it cannot be re-evaluated outside the render. That is precisely why file authorisation records a grant at render time instead of re-checking later (see Files).

effectForConditionalDisplay only appears in the panel once a formula is set (visibleWhen: {conditionalDisplay: "*"}). It lets you choose between: do nothing, disable, hide, or not generate the block at all.

In dev mode the block stays visible, flagged with a badge — otherwise an editor could not reach a block hidden by its own rule.

The effects differ more than they look

  • disabled renders the block, greyed out.
  • hidden renders it and hides it.
  • notLoaded does not generate it at all — so nothing client-side can reveal it.

Choose deliberately: hidden still ships the content to the browser. For anything that must not reach an unauthorised visitor, the answer is notLoaded or a right, not a CSS class.

Never write hidden in customClass

Use the effect. A raw hidden class fights the framework's own show/hide logic and wins at the wrong moment — typically after a showBloc that then appears to do nothing.

linked is a pipe-separated list

linked holds field names joined by |, emitted as an HTML attribute read by checkLinkedFields. It is stored in properties.linked — despite the name, it is not a relation.

Rights

userRightNeeded names a right, which the visitor must hold. For admin pages, the right follows the ADMIN_<SLUG> convention rather than a hard-coded DEV code.

Two traps were recorded when rights were introduced on admin screens: a null publish on an admin URL produced a 404, and every event on an admin screen answered 403 until the right was granted.

Reloading a conditional block

A conditional wrapper needs the hidden effect to have something to act on, and a reload targets the wrapper, not the block inside it. Reloading the inner block only re-renders content whose visibility is decided by its parent.

See also

  • Render functions — showBloc, hideBloc, hideBlockAccordingFieldValue
  • Security — rights are checked again on POST, whatever the display said