mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/structural_pages.git
synced 2026-03-08 01:27:42 -03:00
Update documentation with Site Structure Menu block
Add section describing the dynamic menu block features, configuration options, and usage instructions. Update file structure and changelog. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -186,6 +186,45 @@ Configuration form at `/admin/config/local-modules/site-structure` that allows a
|
||||
- Select which taxonomy vocabularies can be used as parents
|
||||
- Changes automatically update the field configuration
|
||||
|
||||
### 10. Block: Site Structure Menu
|
||||
|
||||
Dynamic menu block that renders hierarchical navigation based on the content structure.
|
||||
|
||||
**Features**:
|
||||
- Automatically detects the ancestor entity (taxonomy term, user, or group)
|
||||
- Renders all content_page hierarchies under the ancestor
|
||||
- Supports configurable depth limit
|
||||
- Highlights active trail (current page and its ancestors)
|
||||
- Proper cache invalidation by node and route
|
||||
|
||||
**Configuration options**:
|
||||
|
||||
| Option | Default | Description |
|
||||
|--------|---------|-------------|
|
||||
| Maximum depth | 3 | Number of levels to display (1-10) |
|
||||
| Show ancestor title | Yes | Display ancestor entity title as header |
|
||||
| Expand active trail | Yes | Highlight the path to current page |
|
||||
|
||||
**Menu structure example**:
|
||||
|
||||
```
|
||||
Documentation (ancestor: taxonomy term)
|
||||
├── Getting Started ← level 1 (content_page → term)
|
||||
│ ├── Installation ← level 2 (content_page → node)
|
||||
│ └── Configuration ← level 2
|
||||
├── User Guide ← level 1 (content_page → term)
|
||||
│ ├── Basic Usage ← level 2
|
||||
│ └── Advanced Topics ← level 2
|
||||
│ └── API Integration ← level 3 (content_page → node)
|
||||
└── FAQ ← level 1 (content_page → term)
|
||||
```
|
||||
|
||||
**Usage**:
|
||||
1. Navigate to Structure > Block layout
|
||||
2. Place "Site Structure Menu" block in desired region
|
||||
3. Configure visibility (e.g., show only on content_page nodes)
|
||||
4. Adjust depth and display options as needed
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
@@ -193,11 +232,12 @@ Configuration form at `/admin/config/local-modules/site-structure` that allows a
|
||||
```
|
||||
site_structure/
|
||||
├── site_structure.info.yml # Metadata and dependencies
|
||||
├── site_structure.module # Hooks (presave, tokens)
|
||||
├── site_structure.module # Hooks (presave, tokens, theme)
|
||||
├── site_structure.install # Installation hooks
|
||||
├── site_structure.services.yml # Service registration
|
||||
├── site_structure.routing.yml # Route definitions
|
||||
├── site_structure.links.menu.yml # Admin menu links
|
||||
├── site_structure.libraries.yml # Asset libraries (CSS)
|
||||
│
|
||||
├── config/
|
||||
│ ├── install/
|
||||
@@ -226,6 +266,12 @@ site_structure/
|
||||
│ └── schema/
|
||||
│ └── site_structure.schema.yml # Config schema
|
||||
│
|
||||
├── css/
|
||||
│ └── site-structure-menu.css # Menu block styles
|
||||
│
|
||||
├── templates/
|
||||
│ └── site-structure-menu.html.twig # Menu block template
|
||||
│
|
||||
├── translations/
|
||||
│ └── pt-br.po # Portuguese (Brazil) translation
|
||||
│
|
||||
@@ -233,8 +279,12 @@ site_structure/
|
||||
│ ├── Breadcrumb/
|
||||
│ │ └── SectionBreadcrumbBuilder.php
|
||||
│ │
|
||||
│ └── Form/
|
||||
│ └── SiteStructureSettingsForm.php
|
||||
│ ├── Form/
|
||||
│ │ └── SiteStructureSettingsForm.php
|
||||
│ │
|
||||
│ └── Plugin/
|
||||
│ └── Block/
|
||||
│ └── SiteStructureMenuBlock.php # Dynamic menu block
|
||||
│
|
||||
└── docs/
|
||||
└── DESIGN.md # This document
|
||||
@@ -343,3 +393,4 @@ The module supports the Group module for content organization:
|
||||
| 1.0.0 | - | Initial version |
|
||||
| 1.1.0 | - | Added dynamic_entity_reference support for multi-type parents |
|
||||
| 1.2.0 | - | Added user and group entity support as parent types |
|
||||
| 1.3.0 | - | Added Site Structure Menu block for dynamic hierarchical navigation |
|
||||
|
||||
Reference in New Issue
Block a user