Skip to content

Commit

Permalink
new ss4 updates, including - Content added back in, legacy mapping ad…
Browse files Browse the repository at this point in the history
…ded, template location and composer updated
  • Loading branch information
josephlewisnz committed Jun 22, 2021
1 parent 2891253 commit 882e027
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Manage site-wide modules (aka widgets) and select the pages on which they are to

* SilverStripe 4

For a Silverstripe CMS 4.x compatible version of this module, please see the 3.x or 4.x release line.

For a Silverstripe CMS 3.x compatible version of this module, please see the 3 branch, or 2.x release line.

## Installation

Expand Down Expand Up @@ -60,7 +63,7 @@ Manage site-wide modules (aka widgets) and select the pages on which they are to
}
```

2. Create your template file `app/templates/Modules/MyModule.ss`:
2. Create your template file `app/templates/{NameSpace}}/MyModule.ss`:
```
<div class="module module_my-module">
<h3>$Title</h3>
Expand Down
3 changes: 3 additions & 0 deletions _config/legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SilverStripe\ORM\DatabaseAdmin:
classname_value_remapping:
Module: PlasticStudio\ModuleManager\Module
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plasticstudio/modulemanager",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"description": "Module Manager for SilverStripe - forked from jaedb/modulemanager",
"homepage": "http://plasticstudio.co.nz/",
"keywords": ["silverstripe"],
Expand All @@ -10,7 +10,11 @@
"name": "James Barnsley",
"homepage": "https://jamesbarnsley.co.nz",
"email": "james@barnsley.nz"
}
},
{
"name": "Joseph Lewis",
"email": "joe@psdigital.co.nz"
}
],
"support": {
"issues": "https://github.com/PlasticStudio/ModuleManager"
Expand Down
5 changes: 3 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Module extends DataObject {

private static $db = [
'Title' => 'Varchar(255)',
'Content' => 'HTMLText',
'Position' => 'Varchar(255)'
];

Expand Down Expand Up @@ -70,11 +71,11 @@ public function Type(){

/**
* Render this module
* This is auto-overwritten by creating a Modules/{ClassName} template in your templates directory
* This is auto-overwritten by creating a {ClassName} template in your templates directory
*
* @return HTMLText
**/
public function Layout(){
return $this->renderWith(['Modules/'.$this->Type(), 'Module']);
return $this->renderWith([$this->Type(), 'Module']);
}
}
2 changes: 1 addition & 1 deletion templates/Module.ss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="module module--{$ClassName}" data-id="{$ID}" data-classname="{$ClassName}">
<div class="module module--{$ClassName.ShortName}" data-id="{$ID}" data-classname="{$ClassName.ShortName}">
<h3 class="module__title">$Title</h3>
<div class="module__content">
This is the base-level module
Expand Down

0 comments on commit 882e027

Please sign in to comment.