[Sugester V2 EN](https://sugester.intum.pl/kb/sugester-v2-en.md) / [Syntax](https://sugester.intum.pl/kb/sugester-v2-en/syntax-en.md)

# [Syntax Template - automatic sections](https://sugester.intum.pl/kb/sugester-v2-en/syntax-template-automatic-sections.md)

## Syntax Template

The `syntax` template is one of the available Knowledge Base templates. It features automatic sections on the homepage that dynamically pull content based on the names of categories and tags of entries.

## Automatic sections on the homepage

### 1. Category Grid

At the top of the homepage, a grid of all main (root) categories is displayed, along with descriptions and the number of entries.

### 2. Latest Entries

This section displays **4 most recently added entries** (sorted by `created_at`). Each entry shows:
- Category name (green badge)
- Entry title
- Abstract or beginning of the content (max 120 characters)

### 3. Popular Entries

This section displays **4 entries with the highest number of views** (sorted by `view_count`). The format is identical to the latest entries, but with a blue category badge.

### 4. FAQ Section (automatic)
<img src="https://s3.eu-west-1.amazonaws.com/attachments.intum.net/public-files/31076/922837b37e00df09d8921ea22b2a66539a93d831" alt="faq" style="max-width: 100%;" />

The FAQ section appears **automatically** if there is a category that meets one of the conditions:

- The category name contains the word `faq`
- The category URL contains the word `faq`
- The category name contains the word `często`
- The category name contains the word `pytania`

**Example category names that will trigger the FAQ section:**
- `FAQ`
- `Frequently Asked Questions`
- `Most Common Questions`

The section displays **the first 10 entries** from this category in an accordion format (expandable questions). Upon clicking, a shortened content (600 characters) and a "Read more" link are shown.

### 5. Video Section (automatic)

<img src="https://s3.eu-west-1.amazonaws.com/attachments.intum.net/public-files/31076/c18235a457a5f2b0bb74af35ce6eed79c2fff340" alt="video section" style="max-width: 100%;" />

The video tutorial section appears **automatically** if there are entries with appropriate tags.

**Tags that trigger the video section:**
- `video`
- `film`
- `movie`
- `wideo`
- `tutorial`
- `poradnik`

**Requirements:**
1. The entry must have one of the above tags
2. The entry should contain a link to YouTube in the content

If the entry contains a YouTube link, the template automatically:
- Extracts the video ID from the URL
- Fetches the thumbnail from `img.youtube.com`
- Displays a play button
- Opens a modal with the YouTube player upon clicking

**Supported YouTube URL formats:**
- `youtube.com/embed/VIDEO_ID`
- `youtube.com/watch?v=VIDEO_ID`
- `youtu.be/VIDEO_ID`

## How to activate sections

<table>
<tr><th>Section</th><th>How to activate</th></tr>
<tr><td>Latest</td><td>Automatically (just need to have entries)</td></tr>
<tr><td>Popular</td><td>Automatically (just need to have entries with views)</td></tr>
<tr><td>FAQ</td><td>Create a category with "faq" or "questions" in the name/URL</td></tr>
<tr><td>Video</td><td>Add the tag <code>video</code>, <code>tutorial</code>, or <code>guide</code> to entries</td></tr>
</table>
## Table of contents of the entry (On this page)

In the single entry view, if the content contains H2/H3 headers, a table of contents "On this page" automatically appears in the right sidebar, highlighting the active section while scrolling.