dravencms / structure
Structure module for dravencms
Requires
- php: ^8.4
- dravencms/admin: ^3.0
- dravencms/application: ^0.3
- dravencms/database: ^0.2.4
- dravencms/locale: >=2.0
- latte/latte: ^3.1
Requires (Dev)
- nette/tester: @dev
Suggests
- dravencms/seo: Adds Structure menu entries to sitemap.xml and robots.txt
Provides
None
Conflicts
- dravencms/admin: <3.2
- dravencms/user: <3.1
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 21:07:00 UTC
README
Content structure and menu routing for DravenCMS applications. The package manages hierarchical menu entries, translated slugs and metadata, CMS component placement, frontend layouts, and route resolution.
Features
- Hierarchical menu and page structure.
- Localized names, slugs, titles, headings, and metadata.
- Dynamic mapping between menu entries and frontend presenter actions.
- CMS component discovery and placement in page layouts.
- Configurable frontend layout directory and presenter mappings.
- Optional sitemap and
robots.txtintegration with DravenCMS SEO. - Provider-defined admin navigation and ACL permissions.
Requirements
- PHP version supported by the installed DravenCMS stack.
- DravenCMS Locale 2.0 or newer.
- DravenCMS Admin 2.0 or newer.
- DravenCMS SEO is optional.
Installation
Install the package with Composer:
composer require dravencms/structure
The DravenCMS package loader reads dravencms.config.neon from the package metadata. When integrating the package without that loader, include the file from your application configuration, adjusting the relative path as needed:
includes: - ../vendor/dravencms/structure/dravencms.config.neon
Configure the extension for your frontend application:
dravencms.structure: tempPath: %appDir%/FrontModule/cms presenterModule: Front presenterMapping: Dravencms\*Module\*Presenter parentClass: Dravencms\FrontModule\SlugPresenter layoutDir: %appDir%/FrontModule/templates defaultLayout: layout mappings: Dravencms\FrontModule\Components\*\*\-\*Factory: Dravencms\Model\*\Repository\*CmsRepository
Apply the resulting database schema changes through the Doctrine migration workflow used by your application. Navigation and ACL definitions come from providers; assign permissions through the group editor.
Configuration
| Option | Purpose |
|---|---|
tempPath |
Directory used for generated CMS templates |
presenterModule |
Frontend module containing routed presenters |
presenterMapping |
Pattern used to resolve presenter classes |
parentClass |
Base presenter used by generated CMS presenters |
layoutDir |
Directory containing frontend layouts |
defaultLayout |
Default layout name for new structure entries |
mappings |
CMS component factory patterns mapped to repository patterns |
templateOverrides |
Optional template-path overrides |
SEO Integration
When dravencms/seo is installed, Structure detects its provider interfaces and registers an integration service automatically. Sitemap-enabled menu entries are contributed to /sitemap.xml, including route parameters, modification dates, priorities, and locale alternates. Entries excluded from the sitemap are contributed as Disallow records to /robots.txt.
Structure does not require SEO, and SEO does not require Structure. The integration service is omitted when the SEO interfaces are unavailable.
License
This package is licensed under the LGPL-3.0 license.
Admin authorization and mutations
Administration uses User 3.1, Admin 3.2 and Application 0.3 guards. Screens and write callbacks enforce the existing provider-defined permissions server-side, including direct URLs and bulk callbacks. Mutating signals require POST and a session-bound action token; synchronize the matching admin assets when upgrading. See the User package's user:security:migrate instructions for the password-reset schema change.