Met de Beslisboom Open Standaarden kunnen mensen die bezig zijn met een IT project binnen de overheid of de (semi) publieke sector in een aantal stappen komen tot een selectie van open standaarden van de 'pas toe of leg uit-lijst die waarschijnlijk relevant zijn. https://www.forumstandaardisatie.nl/beslisboom/beslisboom-open-standaarden
Find a file
2026-09-29 11:00:37 +02:00
code Init with source code dump of 2026-06-21 2026-09-29 10:51:30 +02:00
config Init with source code dump of 2026-06-21 2026-09-29 10:51:30 +02:00
theme Init with source code dump of 2026-06-21 2026-09-29 10:51:30 +02:00
LICENSE.txt Add EUPL-1.2 for now 2026-09-29 11:00:37 +02:00
README.md Init with source code dump of 2026-06-21 2026-09-29 10:51:30 +02:00

Beslisboom (Decision Tree) — source delivery

This bundle contains the source code and configuration of the decision tree ("beslisboom") feature of the Forum Standaardisatie website. It is provided as a source delivery only — it is not a runnable/deployable package and is not expected to run standalone.

What the decision tree is

A decision_tree node whose content is a nested tree of paragraphs:

node: decision_tree
 └─ field_decisiontree_pages → paragraph: decision_tree_page
     ├─ field_title / field_introduction
     └─ field_question_groups → paragraph: decision_tree_question_group
         └─ field_questions → paragraph: decision_tree_question
             ├─ field_question / field_question_type / field_tooltip
             └─ field_answers → paragraph: decision_tree_answer
                 ├─ field_answer / field_explanation
                 └─ field_standards (→ standaarden nodes)

There is also a parallel "specific" QA set and a step-based variant (decision_tree_specific_*, decision_tree_step).

The paragraph tree is flattened to JSON server-side, cached on the node (field_json), and rendered on the front-end by a React app.

Folder layout

  • code/ — custom PHP/JS modules
    • decision_tree_json/ — walks the paragraph tree and produces the JSON (ParseController::parseNode) exposed at /node/{node}/json.
    • bfs_react/ — the React front-end (public decision tree app only) plus the MailOverview webform handler and the decision-tree webform.
    • bfs_decision_tree/ — trimmed to public parts only (see note below).
  • config/ — Drupal configuration (from config/sync/): the decision_tree node type, all decision_tree_* paragraph types, their fields, form/view displays, jsonapi resource configs, and the shared field storages they use.
  • theme/ — the visual front-end parts from the bfs theme (Twig wrapper + SCSS).

Notes

  • Shared field storages are included (e.g. field_standards, field_explanation, field_question, field_body…). These storages are also used by other paragraph/content types in the full site, so they are not exclusive to the beslisboom.

  • Theme: only the decision-tree-specific Twig template and SCSS partials are included, not the whole bfs theme. One relevant hook lives in the shared bfs.theme file and is reproduced here for reference:

    // Implements hook_preprocess_node().
    function bfs_preprocess_node(&$variables): void {
      $node = $variables['node'];
      if ($node->getType() == 'decision_tree') {
        $variables['uuid'] = $node->uuid();
        $variables['base_url'] = $GLOBALS['base_url'];
      }
      // ...
    }
    

    The public React app is attached via hook_entity_view() in code/bfs_react/bfs_react.module.