Reputation: 3421
Im following the original docs but /dev/build
is not generating the db fields and the form fields are not getting generated either.
this is the value of my app/_config/app.yml
---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app
---
Silverstripe\SiteConfig\SiteConfig:
extensions:
- CustomSiteConfig
---
SilverStripe\Admin\LeftAndMain:
extra_requirements_css:
- public/resources/admin/css/custom.css
and this is my app/src/extensions/CustomSiteConfig.php
<?php
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\ORM\DataExtension;
class CustomSiteConfig extends DataExtension
{
private static $db = [
'FooterContent' => 'HTMLText'
];
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab("Root.Main",
new HTMLEditorField("FooterContent", "Footer Content")
);
}
}
Silverstripe is new to me and maybe I'm missing something here. But I'm looking for an hour now and cant get it to work.
Upvotes: 2
Views: 448
Reputation: 24406
I think the problem is in the way you're structuring your YAML:
---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app
---
Silverstripe\SiteConfig\SiteConfig:
extensions:
- CustomSiteConfig
---
SilverStripe\Admin\LeftAndMain:
extra_requirements_css:
- public/resources/admin/css/custom.css
The ---
blocks are notating title blocks for each section of config, so the dividers you're using after the section with Name: myproject
in it are creating more title blocks which won't be treated as config any more.
Try this:
---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app
Silverstripe\SiteConfig\SiteConfig:
extensions:
- CustomSiteConfig
SilverStripe\Admin\LeftAndMain:
extra_requirements_css:
- public/resources/admin/css/custom.css
Upvotes: 2