CoolCMS API

OutlineLatteExtension extends Extension
in package

FinalYes

The `outline` filter builds an outline from HTML content and adds anchors to headings.

Usage in a text page layout:

{capture $contentHtml}{include #content}{/capture}
{var $outline = ($contentHtml|outline)}
{$outline['html']|noescape}          {* content with `id` on headings *}
{foreach $outline['items'] as $item} {* navigation items *}

IMPORTANT: print the content from $outline['html'], not from the original variable; the anchors exist only in the returned copy, so the original has no heading ids.

Table of Contents

Methods

getFilters()  : array<string|int, mixed>

Methods

getFilters()

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results