Charts · Gutenberg

Decision Tree block for WordPress

Interactive step-by-step decision tree. Visitors answer yes/no (or custom) questions and follow branches to a personalised result. Fully editable node graph with breadcrumb trail and back navigation.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Interactive step-by-step decision tree. Visitors answer yes/no (or custom) questions and follow branches to a personalised result. Fully editable node graph with breadcrumb trail and back navigation.

Inspector panels on this block: Content, Nodes (' + a.nodes.length +. Those titles come from index.js, not from a shared template.

Behavior controls: “Type” options: Question (has branches), Result (leaf node).

Where to find it

Gutenberg inserter → Charts → search “Decision Tree” (block name `blockenberg/decision-tree` in block.json). Style it in the sidebar after insert.

How to use Decision Tree block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Decision Tree”, insert it. Category: Charts.
  3. Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.
  4. Check the published page. The view script reads HTML data attributes: data-opts, data-rendered. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Content — TitleText field in the inspector. block.json default: Find Your Perfect Stack. Saved as `title`.
Show titleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
SubtitleText field in the inspector. block.json default: Answer a few questions to find the right technology for your project. Saved as `subtitle`.
Show subtitleOn/off toggle in the inspector. On by default. Saved as `showSubtitle`.
Root (starting) nodeSelect control; the chosen value is saved on the block. block.json default: q1. Saved as `rootId`.
Show breadcrumb trailOn/off toggle in the inspector. On by default. Saved as `showBreadcrumb`.
Show step progressOn/off toggle in the inspector. On by default. Saved as `showProgress`.
Node IDText field in the inspector. Saved as `nodes`.
TypeSelect control; the chosen value is saved on the block. Options: Question (has branches); Result (leaf node). Saved as `nodes`.
Yes labelText field in the inspector. Saved as `nodes`.
Yes → goes to nodeSelect control; the chosen value is saved on the block. Saved as `nodes`.
No labelText field in the inspector. Saved as `nodes`.
No → goes to nodeSelect control; the chosen value is saved on the block. Saved as `nodes`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
Subtitle (Typo Subtitle)Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoSubtitle`.
Question sizeNumeric range control in the inspector. Range 14–30. block.json default: 18. Saved as `questionSize`.
Body font sizeNumeric range control in the inspector. Range 12–20. block.json default: 15. Saved as `fontSize`.
Breadcrumb font sizeNumeric range control in the inspector. Range 9–18. block.json default: 12. Saved as `breadcrumbFontSize`.
Border radiusNumeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `borderRadius`.
Card radiusNumeric range control in the inspector. Range 0–24. block.json default: 12. Saved as `cardRadius`.
Padding topNumeric range control in the inspector. Range 0–120. block.json default: 48. Saved as `paddingTop`.
Padding bottomNumeric range control in the inspector. Range 0–120. block.json default: 48. Saved as `paddingBottom`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Card BGColor control in the inspector. block.json default: #f8fafc. Saved as `cardBg`.
Card borderColor control in the inspector. block.json default: #e2e8f0. Saved as `cardBorder`.
Colors — TitleColor control in the inspector. block.json default: #0f172a. Saved as `titleColor`.
SubtitleColor control in the inspector. block.json default: #64748b. Saved as `subtitleColor`.
Question textColor control in the inspector. block.json default: #0f172a. Saved as `questionColor`.
Yes button BGColor control in the inspector. block.json default: #22c55e. Saved as `yesBg`.
Yes button textColor control in the inspector. block.json default: #ffffff. Saved as `yesText`.
No button BGColor control in the inspector. block.json default: #ef4444. Saved as `noBg`.
No button textColor control in the inspector. block.json default: #ffffff. Saved as `noText`.
Back button BGColor control in the inspector. block.json default: #f1f5f9. Saved as `backBg`.
Back button textColor control in the inspector. block.json default: #374151. Saved as `backText`.
BreadcrumbColor control in the inspector. block.json default: #94a3b8. Saved as `breadcrumbColor`.
Result textColor control in the inspector. block.json default: #ffffff. Saved as `resultTextColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Decision Tree block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Decision Tree”. It sits under Charts. After insert, open Content and set “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.

What makes Decision Tree different from other Blockenberg blocks?

Interactive step-by-step decision tree. Visitors answer yes/no (or custom) questions and follow branches to a personalised result. Fully editable node graph with breadcrumb trail and back navigation. Inspector labels on this block include “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.

Is the Decision Tree Gutenberg block free?

Yes. Decision Tree ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Decision Tree to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Nodes (' + a.nodes.length +).

Related charts blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Decision Tree from the Gutenberg inserter.

Get Blockenberg