diff --git a/action.php b/action.php index e081f7f..69d5190 100644 --- a/action.php +++ b/action.php @@ -41,12 +41,14 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin { if ( $event->data['view'] !== 'page' ) { return; } - // Only add links if the current page is not included in a namespace - if ( ! empty($INFO['namespace']) ) { - return; - } // Get the list of children pages $children_types = $this->getConf('children_list'); + // Only add links if the current page is not included in a reserved namespace + $top_namespace = explode(':', $INFO['namespace'])[0]; + if ( in_array($top_namespace, $children_types) ) { + return; + } + // Add menu items for each child page foreach ( $children_types as $child_type ) { $child_label = $this->getLang("btn_$child_type"); $this->addMenuItem($event, $child_type, $child_label);