Skip to content

Commit

Permalink
docs: Revise table of contents and fix typos (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Nov 25, 2024
1 parent 90b744e commit 465a4ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
single: Plugins

############################
Standard Component plugins
Standard component plugins
############################

``djangocms-frontend`` adds a set of plugins to Django-CMS to allow for
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ Contents
:maxdepth: 3

getting_started
custom_components
grid
components
custom_components
plugins/toc
how-to/index
reference
Expand Down
30 changes: 19 additions & 11 deletions docs/source/plugins/toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,38 @@ To create a table of contents:
Positioning at Top of Page
==========================

Table of contents at the top Example
------------------------------------

Since the TOC must be placed after headings to collect them, use grid layouts to display it at the top:

1. Create a container
2. Add a row with two columns
3. In the first (bottom) column: Add your content with Heading plugins
4. In the second (top) column: Add the TOC plugin
5. Set the column width and order: Both columns should cover full width (typically 12/12),
the second columns should be shown before (i.e., at the top) the first (then at the bottom)

Two Column Layout Example
-------------------------

1. Create a container
2. Add a row with two columns
3. In the first (left) column:
- Add the TOC plugin
4. In the second (right) column:
- Add your content with Heading plugins
3. In the first (left) column: Add your content with Heading plugins
4. In the second (right) column: Add the TOC plugin
5. Set column widths appropriately (e.g., 3/9 split)

Example Structure::

Container
└── Row
├── Column (col-3)
── TOC Plugin
── Column (col-9)
├── Heading Plugin
── Content...
── Heading Plugin
└── More content...
├── Column (col-9)
── Heading Plugin
│ ├── Content...
├── Heading Plugin
── More content...
── Column (col-3)
└── TOC Plugin

This creates a sidebar layout with the TOC always visible while scrolling through content.

Expand Down

0 comments on commit 465a4ba

Please sign in to comment.