Inhaltsverzeichnis

pagenav: start als erste Seite

Datum 2026-11-04
KI Claude (claude-opus-5-5)
Status erledigt
Vorherige Sitzung 2026-11-03_galaxy
Bezug manual, edwiki

Ziel

Im Plugin pagenav ([<>]) wurde die start-Seite als letzte Seite gewertet. Sie soll die erste sein, damit man von start aus durch die Kapitel blättern kann.

Ergebnis / aktueller Stand

Entscheidungen

Verworfen

Offene Punkte

Nächste Schritte

  1. –

Technische Details

handle(), Zeile 41:

list($mode, $glob) = array_pad(explode(' ', $match, 2), 2, '');

render(): ersetzt den Block von $cnt = count($list); bis zum Ende der for-Schleife:

// build the page sequence: the start page always comes first, followed
// by the other pages in their sorted order. The current page always
// stays in the sequence, even if the filters would exclude it
$pages = array();
if ($id == $start || (!$glob && page_exists($start))) {
    $pages[] = $start;
}
foreach ($list as $item) {
    if ($item['id'] == $start) continue;
    if ($item['id'] != $id) {
        if ($glob && !preg_match('/' . $glob . '/', noNS($item['id']))) continue;
        if (isHiddenPage($item['id'])) continue;
    }
    $pages[] = $item['id'];
}
 
$cnt = count($pages);
if ($cnt < 2) return true; // there are no other doc in this namespace
 
// a page that is not in the list (eg. preview of a new page) goes to the end
$pos = array_search($id, $pages, true);
if ($pos === false) $pos = $cnt;
 
$first = $pos > 0 ? $pages[0] : '';
$prev = $pos > 0 ? $pages[$pos - 1] : '';
$next = $pos < $cnt - 1 ? $pages[$pos + 1] : '';
$last = $pos < $cnt - 1 ? $pages[$cnt - 1] : '';

Für die nächste KI

pagenav ist im Dev-Wiki lokal gepatcht. Vor einem Update des Plugins oder beim Umzug auf das Produktivsystem an diese Seite denken. Sonst weiter laut struktur (Teil 7b).