Released under the MIT license. Copyright (c) 2013 mcbSolutions.at
Version 0.3; Please report errors.
Generates a table of contents for the current page.
- Copy/save the plugin into
plugins
folder
-
Add
<link rel="stylesheet" href="{{ base_url }}/plugins/mcb_TableOfContent/style.css" media="screen,projection,print"> <link rel="stylesheet" href="{{ base_url }}/plugins/mcb_TableOfContent/print.css" media="print">
in the
head
section of your layout file. -
Optional - Smooth scrolling: Add
<script src="{{ base_url }}/plugins/mcb_TableOfContent/code.js"> </script>` after `<script src="{{ base_url }}/vendor/jquery/jquery.min.js"></script>
inside the
head
section. -
Add
{{ mcb_toc_top }}
directly after thebody
tag. -
Add
{{ mcb_toc }}
where you want the table of contents displayed.
integer
Only display header h1 to hn
(where n
is 1-6). Default is 3
.
$config['mcb_toc_depth'] = 3;
integer
Only generate Table of content with at least n
headers. Default is 3
.
$config['mcb_toc_min_headers'] = 3;
string
Text to display for "Move to top". Default is Top
.
$config['mcb_toc_top_txt'] = 'Top';
string
Text to display as caption for the table of contents. Default is Table of contents
.
$config['mcb_toc_caption'] = 'Table of contents';