What is a content node?
A content node represents a single item in your channel’s content hierarchy. It can be:- A topic - A folder containing other nodes
- A resource - Educational content like videos, documents, or exercises
ContentNode model (models.py:1810) which extends Django MPTT’s MPTTModel.
MPTT tree structure
Kolibri Studio uses Modified Preorder Tree Traversal (MPTT) to organize content hierarchically. MPTT stores tree information in these fields:MPTT allows efficient tree queries:
- Get all descendants with a single query
- Determine parent-child relationships without recursion
- Move subtrees efficiently
Tree traversal example
Consider this content structure:lft > 1 AND rght < 10 AND tree_id = 1
Content node fields
Identity fields
- id - Internal Studio ID (changes when copied)
- node_id - Kolibri node ID (used for tracking in Kolibri)
- content_id - Identifies content across copies (for learner progress tracking)
Metadata fields
Source tracking
These fields track content provenance when copying:- original_channel_id - The very first channel this content came from
- source_channel_id - The immediate channel this was copied from
- original_source_node_id - Original node_id
- source_node_id - Immediate source node_id
State tracking
Metadata labels
These JSONField properties store applied labels:Role visibility
LEARNER- All usersCOACH- Only coaches and admins
Exercise-specific fields
For exercise content types, additional data is stored inextra_fields:
Tree operations
Getting tree data
Theget_tree_data() method (models.py:2106) returns a nested structure:
Moving nodes
MPTT handles tree restructuring automatically when you change theparent field:
Node types and hierarchy
Topics
Topics are container nodes that organize other content:- Can contain child nodes
- Form the structure of your channel
- Cannot have files attached
Resources
Resource nodes contain actual educational content:- Can have files attached via the
Filemodel - Cannot have children (leaf nodes)
- Counted in channel resource statistics
Relationships
Prerequisites
Related content
Tags
Permissions and filtering
Content nodes inherit permissions from their channel (models.py:2037):
tree_id to determine which channel a node belongs to.
Tree ID management
Each channel’s content trees have uniquetree_id values. The MPTTTreeIDManager model (models.py:743) ensures concurrent tree creation doesn’t conflict:
Working with descendants
MPTT provides efficient descendant queries:Related models
- Channels - The container for content node trees
- Content types - Different kinds of content nodes
- Licensing - License requirements for content
Next steps
Content types
Learn about the different types of content nodes
Organizing content
Best practices for structuring your channel
