Translations of this page:
  • en
Index Key Link
action Click to view
add Click to view
affiliation Click to view
align Click to view
alignment Click to view
alpha Click to view
analog clock Click to view
animated image Click to view
app drawer Click to view
app group Click to view
application Click to view
audio Click to view
background Click to view
backup Click to view
beginner Click to view
behavior Click to view
blur Click to view
calendar Click to view
card Click to view
checklist Click to view
circle indicator Click to view
clean slate Click to view
clock Click to view
code block Click to view
code of conduct Click to view
color picker Click to view
communities Click to view
compass Click to view
compatibility Click to view
complementary color Click to view
conceptual learning Click to view
configure Click to view
contact Click to view
contrast Click to view
contribute Click to view
date Click to view
date / time Click to view
default launcher Click to view
delete Click to view
desktop Click to view
developer Click to view
discussion guideline Click to view
distribution Click to view
drawer Click to view
drawer handle Click to view
dual-screen Click to view
dynamic color Click to view
dynamic image Click to view
dynamic text Click to view
edit Click to view
editing Click to view
edit mode Click to view
export Click to view
feature Click to view
file naming Click to view
flip-style Click to view
foldable Click to view
folder Click to view
font Click to view
full screen Click to view
gaussian Click to view
gesture Click to view
getting started Click to view
gradient Click to view
group Click to view
heading Click to view
help Click to view
hide Click to view
html Click to view
hue Click to view
icon Click to view
import Click to view
install Click to view
installation Click to view
instructable Click to view
intellectual property Click to view
issue Click to view
key Click to view
keys & gestures Click to view
label Click to view
landscape mode Click to view
launcher action Click to view
layout Click to view
liability Click to view
lifetime purchase Click to view
light source Click to view
link Click to view
list Click to view
luminance Click to view
macro Click to view
macrodroid Click to view
margin Click to view
mask Click to view
media controller Click to view
mobile Click to view
month/year/day Click to view
move Click to view
multi-screen Click to view
namespace Click to view
navigation Click to view
object Click to view
object design menu Click to view
official Click to view
official blog Click to view
offset Click to view
option Click to view
ordinal Click to view
page Click to view
page indicator Click to view
paste Click to view
performance Click to view
permission Click to view
pin Click to view
png Click to view
quoting Click to view
radius Click to view
registration Click to view
reminder Click to view
remove Click to view
resource Click to view
rotate Click to view
rss Click to view
save Click to view
scroll Click to view
search Click to view
select Click to view
shadow Click to view
shape Click to view
share Click to view
sidebar Click to view
slider Click to view
sliding drawer Click to view
spacing Click to view
stretch Click to view
syntax Click to view
system setting Click to view
system ui Click to view
table Click to view
table of content Click to view
tasker Click to view
taxonomy Click to view
temperature Click to view
termination Click to view
terms of use Click to view
text Click to view
theme Click to view
toby Click to view
trademark Click to view
transform Click to view
transparency Click to view
transparent Click to view
troubleshooting Click to view
typeface Click to view
ui Click to view
user conduct Click to view
user interface demo Click to view
variable Click to view
wallpaper Click to view
warranties Click to view
weather Click to view
webp Click to view
website Click to view
welcome Click to view
widget Click to view
wiki Click to view
wiki editing Click to view
window Click to view

For one full year from April 19, 2026, this page proudly demonstrates the stabilized TOC behavior achieved through the Condition and Include plugin refinements.
All heading levels render cleanly, without cascading or duplication — a verified, cross‑environment success.

2026/04/19 00:44 · 0 Comments

Condition Plugin, Include Plugin, and TOC Interaction (Resolution – April 2026)

This page documents the resolution of a cascading Table of Contents issue that occurred when using the Condition plugin alongside the Include plugin in a PHP 8 environment. It is published for the benefit of other administrators who may encounter similar behavior.

Summary

A page that used the Condition plugin to display a time‑based announcement behaved correctly on a local DokuWiki installation but produced duplicate and cascading TOC entries when deployed to a shared hosting environment. The issue was reproducible only when the Condition plugin and an Include block were placed near the top of the page, causing the parser to misinterpret heading boundaries.

The root cause was a combination of:

  • The Condition plugin’s TOC‑merging behavior in both XHTML and metadata modes
  • The Include plugin creating implicit section boundaries
  • A DokuWiki parser rule that no plugin block may appear between the page title and the first heading
  • Differences in PHP 8 handling of the Condition plugin’s internal logic
  • The discovery that plugin blocks placed immediately after the first heading also destabilize TOC construction
  • The final finding that an Include block is safe only when placed at the very top of the page, before all headings, where it is evaluated during the pre‑parse stage rather than during TOC assembly

After applying PHP 8 compatibility fixes and restructuring the page so that the Include banner appears as the first element on the page—above the page title and before any headings—the TOC stabilized, and the Condition plugin behaved consistently across environments.

Environment

  • DokuWiki: current stable release
  • PHP: 8.x
  • Condition plugin: original Etienne Méleard version with local fixes
  • Include plugin: standard
  • Discussion plugin: enabled
  • Hosting: shared hosting environment

Technical Findings

1. Condition Plugin Behavior

The Condition plugin merges TOC arrays during rendering. When a Condition block appears before the first heading, the merge occurs before DokuWiki has established the page’s section structure. This results in duplicated or flattened TOC entries.

Local fixes applied:

  • Guard against null TOC arrays
  • Skip ``document_start`` and ``document_end`` instructions
  • Safe metadata TOC merging
  • Added PHP 8‑safe string offsets

2. Include Plugin Interaction

The Include plugin introduces implicit section boundaries. When combined with Condition blocks above the first heading, this caused the parser to enter a “frozen heading state,” producing:

  • duplicated top‑level headings
  • cascading TOCs
  • phantom sections

Wrapping the include with ``nosection`` prevents this.

3. Structural Rule (Critical)

DokuWiki cannot tolerate plugin blocks between the page title and the first heading.

Rule: Do not place Condition, Include, or WRAP blocks between the page title and the first heading.

This is a core parser behavior, not a plugin bug.

Temporal Conditions

The Condition plugin’s ``time`` test accepts full date-and-time formats. A ``date`` test has been added locally and mirrors the same logic.

Examples:
<if date >= 2026-04-01>
Content visible on or after April 1, 2026.
</if>

<if date >= 2026-04-01 && date ⇐ 2026-04-20>
Content visible only during April 1–20, 2026.
</if>

<if date >= “2026-04-01 08:00” && date < “2026-04-01 17:00”>
Content visible during business hours on April 1.
</if>

Rules for Stable Operation

  • No plugin blocks above the first heading
  • Wrap includes with ``nosection``
  • Do not wrap headings inside Condition blocks
  • Purge cache after modifying Condition logic (``?do=purge``)
  • Avoid Condition blocks inside table cells

Resolution

After applying the PHP 8 fixes, adding the ``date`` test, and restructuring the page so that the Include banner appears as the first element on the page, the TOC now renders correctly, and the Condition plugin behaves consistently across environments. This placement ensures that conditional and included content is fully evaluated before DokuWiki constructs the TOC, preventing cascading, duplication, and frozen heading states across all tested environments.

Discussion

Enter your comment. Wiki syntax is allowed:
Please solve the following equation to prove you're human. 101 +9 =