Créer un index en Typoscript

Avec la fin de l’année qui approche, voici une petit exemple pour créer un index sur une page.

Sur une page, l’index liste les différents éléments de contenu qui la compose et renvoie vers ceux-ci.

Il faudra bien entendu mapper ce code à l’endroit où vous voulez qu’il figure sur votre page.

#####################################################################

# [summary]

lib.summary = COA
lib.summary {
    30 = TEXT
    30 < styles.content.get
    30 {
        stdWrap.wrap = <ul>|</ul>
        select.andWhere = sectionIndex!=0
        select.pidInList.override.field = pages
        renderObj = TEXT
        renderObj {
            noBlur = 1
            fieldRequired = header
            trim=1
            field = header
            htmlSpecialChars = 1
            wrap = <li>|</li>
            typolink.parameter.field = pid
            typolink.section.field = uid
            typolink.ATagParams = style="color: #000000; text-decoration: none;"
        }
        stdWrap.if.isTrue.numRows {
            table = tt_content
            select {
                where = sectionIndex!=0
                andWhere = colPos =0
                andWhere = hidden =0
                pidInList = this
                pidInList.override.field = pages
            }
        }
    }
}

voilà voilà