====== Descendant Pages ======
===== About =====
''Descendant pages'' are [[docs:theme:template:template|pages]] that have the same or a higher [[docs:page:level|level]] than the current page in the [[docs:page:system:system|page system]].
The descendant's pages can be queried to create an illustrative list in [[docs:page:system:index|index pages]].
===== Query =====
You can query them by using the ''descendants'' table of the [[docs:templating:sql|page sql]].
Example:
* All descendants [[docs:page:system:index|index page]] (''is_index = 1'')
* in the next [[docs:page:level|level]] (''depth = 1'') than the [[:docs:docs|root home page for the documentation]]
* ordered by [[docs:page:name|page name]] ascendant
select from descendants where is_index = 1 and depth = 1 order by name asc
If you take this query and use it:
* in a [[docs:templating:iterator|iterator]]
select from descendants where is_index = 1 and depth = 1 order by path asc limit 10
* [[$path|$name]] (Level: $level)
you would get the second level [[docs:page:system:index|index page]] (we have limited to 10 with the ''limit 10'' clause).