wy / neos-static-pages
A easy way to include a predesigned page into Neos CMS
Installs: 3 587
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:neos-package
Requires
- php: >=7.4
- neos/neos: ^5.0 || ^7.0 || ^8.0
- symfony/css-selector: ^4.4 || ^5.0 || ^6.0
- symfony/dom-crawler: ^4.0 || ^5.0
README
A easy way to include a predesigned page into Neos CMS.
Install
composer require wy/neos-static-pages
Usage
Just in assign the Wysiwyg.StaticPages:Mixin.StaticPage
to your Neos.Neos:Document
and define some static pages in the Settings.yaml
. E.g.:
Wysiwyg: StaticPages: pageGroups: default: firstPage: label: 'First Test Page' icon: 'fa-solid fa-bold' file: 'ProjectSite/my-prediesigned-page.php' dimensionConstraints: language: ['de']
Now you can use the page content, stylesheets and scripts in your page with the following Fusion prototypes:
Wysiwyg.StaticPages:Content
Wysiwyg.StaticPages:Stylesheets
Wysiwyg.StaticPages:JavaScripts.Body
Wysiwyg.StaticPages:JavaScripts.Head
If you want to use multiple page groups you can configure it like this:
Wysiwyg: StaticPages: pageGroups: default: firstPage: label: 'First Test Page' icon: 'fa-solid fa-bold' file: 'ProjectSite/my-prediesigned-page.php' dimensionConstraints: language: ['de'] anotherGroup: firstPage: label: 'Another Test Page' icon: 'fa-solid fa-bold' file: 'ProjectSite/my-prediesigned-page.php' dimensionConstraints: language: ['de']
And set the page group to the data source property:
'My.Super:Document': extends: 'Neos.Neos:Document': true 'Wysiwyg.StaticPages:Mixin': true properties: staticPage: ui: inspector: editorOptions: dataSourceAdditionalData: group: 'anotherGroup'
Reference
Config
Wysiwyg: StaticPages: rootFolder: '%FLOW_PATH_ROOT%' # Root folder for page file lookup contentSelector: 'main' # a css selector for extracting the content from the page pageGroups: default: [] # the default page group for the page select
Eel helpers
Helper | Description |
---|---|
StaticPages.Loader.content('group%pageKey') |
Returns the page content |
StaticPages.Loader.stylesheets('group%pageKey') |
Returns the page stylesheets from the documents head |
StaticPages.Loader.headScripts('group%pageKey') |
Returns the page JavaScripts from the documents head |
StaticPages.Loader.bodyScripts('group%pageKey') |
Returns the page JavaScripts from the documents body |
Fusion prototypes
Prototype | Description |
---|---|
Wysiwyg.StaticPages:Content |
Renders the selected page content of the current document |
Wysiwyg.StaticPages:Stylesheets |
Renders the selected page stylesheets of the current document |
Wysiwyg.StaticPages:JavaScripts.Body |
Renders the selected page body JavaScripts of the current document |
Wysiwyg.StaticPages:JavaScripts.Head |
Renders the selected page head JavaScripts of the current document |