Add table of contents

Add table of contents

The following describes how to create a table of contents from the contents of the main section. The table of contents should be displayed after the header.

Example Part 1: Adding an automatic table of contents
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>My Template</title>
  5.     <meta charset="UTF-8">
  6. </head>
  7. <body>
  8. [CONTAINER name='header' label='Header']...[/CONTAINER]

  9. [INDEX name='index' container='main' type='div']
  10. [TOP]
  11. <table cellspacing="0" cellpadding="0" width="640" align="center">
  12.   <tr>
  13.     <td><b>Table of Contents</b><br />
  14. [/TOP]
  15. [BOTTOM]
  16.     </td>
  17.   </tr>
  18. </table>
  19. [/BOTTOM]
  20. [INDEXITEM type='ul']
  21.   <li>[INDEXITEMANCHOR type='a' attributes=''][INDEXITEMNAME /][/INDEXITEMANCHOR]</li>
  22. [/INDEXITEM]
  23. [/INDEX]
For elements in the container name='main' to be included in the table of contents, they must be extended.

Variant 1: Anchor tag
Variant 2: index attribute on the input
Variant 1: Anchor tag
Add an [ANCHOR /] tag to the desired element. The anchor mark will be inserted at this point.

Example Part 2: Extending an element (Variant 1)
  1. [CONTAINER name='main' label='Main section']
  2.   [BETWEEN]<br /><br />[/BETWEEN]

  3.   [ELEMENT name='article' label='Article - Text with Headline' default='true']
  4.   <table cellspacing="0" cellpadding="0" width="640" align="center">
  5.     <tr>
  6.       <td>
  7.         [ANCHOR /]
  8.         [INPUT name='headline' label='Headline' type='h1' rows='2' default='Headline']
  9.         [INPUT name='text' label='Text' type='p' rows='8' default='This is the article text.']
  10.       </td>
  11.     </tr>
  12.   </table>            
  13.   [/ELEMENT]
  14. [/CONTAINER]

  15. [CONTAINER name='footer' label='Footer']...[/CONTAINER]
  16. </body>
  17. </html>
A new input "Table of Contents" has been added to the element settings. Using this input field, you can individually decide whether the article should be included in the table of contents and how the entry should appear there.

Container

If this is filled in, the corresponding anchor link will appear in the table of contents.
Variant 2: index attribute on the input
Add the attribute index='true' to an input. Typically, the main headline is used for this. With this variant, the table of contents entry is always created when the headline input is filled.

Example Part 2: Extending an element (Variant 2)
  1. [CONTAINER name='main' label='Main section']
  2.   [BETWEEN]<br /><br />[/BETWEEN]

  3.   [ELEMENT name='article' label='Article - Text with Headline' default='true']
  4.   <table cellspacing="0" cellpadding="0" width="640" align="center">
  5.     <tr>
  6.       <td>
  7.         [INPUT name='headline' label='Headline' type='h1' rows='2' default='Headline' index='true']
  8.         [INPUT name='text' label='Text' type='p' rows='8' default='This is the article text.']
  9.       </td>
  10.     </tr>
  11.   </table>            
  12.   [/ELEMENT]
  13. [/CONTAINER]

  14. [CONTAINER name='footer' label='Footer']...[/CONTAINER]
  15. </body>
  16. </html>