diff --git a/composer.json b/_composer.json
similarity index 100%
rename from composer.json
rename to _composer.json
diff --git a/docs/en/00_Getting_Started/00_Server_Requirements.md b/docs/en/00_Getting_Started/00_Server_Requirements.md
index a4bff6cdc..49d8e5335 100644
--- a/docs/en/00_Getting_Started/00_Server_Requirements.md
+++ b/docs/en/00_Getting_Started/00_Server_Requirements.md
@@ -1,6 +1,13 @@
+---
+title: Server Requirements
+icon: server
+summary: What you will need to run Silverstripe CMS on a web server
+---
+
+
# Requirements
-SilverStripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser
+Silverstripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser
to access a web-based GUI to do their day-to-day work. Website designers and developers require access to the files on
the server to update templates, website logic, and perform upgrades or maintenance.
diff --git a/docs/en/00_Getting_Started/02_Composer.md b/docs/en/00_Getting_Started/02_Composer.md
index f24618ce8..3e2878ccb 100644
--- a/docs/en/00_Getting_Started/02_Composer.md
+++ b/docs/en/00_Getting_Started/02_Composer.md
@@ -1,3 +1,8 @@
+---
+title: Composer
+summary: What is composer and how to use it with Silverstripe CMS
+---
+
# Installing and Upgrading with Composer
Composer is a package management tool for PHP that lets you install and upgrade SilverStripe and its modules. Although installing Composer is one extra step, it will give you much more flexibility than just downloading the file from silverstripe.org. This is our recommended way of downloading SilverStripe and managing your code.
@@ -19,9 +24,9 @@ You can then run Composer commands by calling `composer`. For example:
composer help
```
-
+[hint]
It is also possible to keep `composer.phar` out of your path, for example, to put it in your project root. Every command would then start with `php composer.phar` instead of `composer`. This is handy if need to keep your installation isolated from the rest of your computer's set-up, but we recommend putting composer into the path for most people.
-
+[/hint]
#### Updating composer
@@ -99,9 +104,9 @@ composer search silverstripe
This will return a list of package names of the forum `vendor/package`. If you prefer, you can search for packages on [packagist.org](https://packagist.org/search/?q=silverstripe).
-
+[warning]
**Version constraints:** `master` is not a legal version string - it's a branch name. These are different things. The version string that would get you the branch is `dev-master`. The version string that would get you a numeric branch is a little different. The version string for the `4` branch is `4.x-dev`.
-
+[/warning]
## Updating dependencies
diff --git a/docs/en/00_Getting_Started/03_Environment_Management.md b/docs/en/00_Getting_Started/03_Environment_Management.md
index 7584d9c24..9a9725767 100644
--- a/docs/en/00_Getting_Started/03_Environment_Management.md
+++ b/docs/en/00_Getting_Started/03_Environment_Management.md
@@ -1,3 +1,8 @@
+---
+title: Environment Management
+summary: How to configure your server environment for Silverstripe CMS
+---
+
# Environment management
As part of website development and hosting it is natural for our sites to be hosted on several different environments.
@@ -59,9 +64,9 @@ SilverStripe\Core\Injector\Injector:
MyProperty: '`ENV_VAR_HERE`'
```
-
+[info]
Environment variables cannot be used outside of Injector config as of version 4.2.
-
+[/info]
## Including an extra `.env` file
diff --git a/docs/en/00_Getting_Started/04_Directory_Structure.md b/docs/en/00_Getting_Started/04_Directory_Structure.md
index 2f5b2d1fc..a7733de76 100644
--- a/docs/en/00_Getting_Started/04_Directory_Structure.md
+++ b/docs/en/00_Getting_Started/04_Directory_Structure.md
@@ -1,3 +1,9 @@
+---
+title: Directory Structure
+summary: An overview of what each directory contains in a Silverstripe CMS installation
+icon: sitemap
+---
+
# Directory Structure
## Introduction
diff --git a/docs/en/00_Getting_Started/05_Common_Problems.md b/docs/en/00_Getting_Started/05_Common_Problems.md
deleted file mode 100644
index 4aad7fe23..000000000
--- a/docs/en/00_Getting_Started/05_Common_Problems.md
+++ /dev/null
@@ -1,155 +0,0 @@
-# Common Problems
-
-From time to time, things will go wrong. Here's a few things to try when you're confused.
-
-## The output shows only "Website Error"
-
-This first and foremost means that your environment is set to "live mode" (see [environment-management]), which disallows
-detailed error messages for security reasons. You'll typically need to get your environment into "dev mode" to see more
-information.
-
-If you can log-in to the CMS as an administrator, append `?isDev=1` to any URL to temporarily set your browsing session into
-"dev mode". If you can't log-in in the first place because of the error, please
-configure an `SS_ENVIRONMENT_TYPE` through [environment-management] (don't forget to remove it afterwards!).
-
-
-On "live" environments, the `?isDev=1` solution is preferred, as it means that your other visitors don't see ugly
-(and potentially security sensitive) PHP errors as well.
-
-
-## mod_rewrite isn't working but it's installed (prior to SilverStripe 3.1.11)
-
-Due to some changes to `mod_dir` in [Apache 2.4](http://httpd.apache.org/docs/current/mod/mod_dir.html#DirectoryCheckHandler)
-(precedence of handlers), index.php gets added to the URLs as soon as you navigate to the homepage of your site.
-To fix this place the following within the `mod_rewrite` section of your .htaccess file:
-
-```
-
- # Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
-
- DirectoryIndex disabled
-
-# ------ #
-
-```
-
-## My templates don't update on page refresh
-
-Putting ?flush=1 on the end of any SilverStripe URL will clear out all cached content; this is a pretty common solution
-to a lot of development problems. Here are some specifics situations:
-
-* You've created a new SS or PHP file
-* You've edited a nested template (one inserted with the `<% include %>` tag)
-* You've published a new copy of your site
-* You've upgraded your version of SilverStripe
-
-## A SQL query fails with "Column not found" or "Table not found"
-
-Whenever you change the model definitions in PHP (e.g. when adding a property to the [$db](api:SilverStripe\ORM\DataObject::$db) array,
-creating a new page type), SilverStripe will need to update the database. Visiting `http://localhost/dev/build` in
-your browser runs a script that will check the database schema and update it as necessary. Putting `?flush=1` on the
-end makes sure that nothing that's linked to the old database structure will be carried over. If things aren't saving,
-pages aren't loading, or other random things aren't working it's possible that the database hasn't been updated to
-handle the new code. Here are some specifics situations:
-
-* You've created a new page type / other data object type
-* You've change the type of one of your database fields
-* You've published a new copy of your site
-* You've upgraded your version of SilverStripe
-
-## My edited CMS content doesn't show on the website
-
-If you've set up your site and it used to be working, but now it's suddenly totally broken, you may have forgotten to
-publish your draft content. Go to the CMS and use the "publish" button. You can visit `admin/pages/publishall` to publish
-every page on the site, if that's easier. Note that this will only work on smaller websites.
-
-## I can see unparsed PHP output in my browser
-
-Please make sure all code inside `*.php` files is wrapped in classes. Due to the way [ClassManifest](api:SilverStripe\Core\Manifest\ClassManifest)
-includes all files with this extension, any **procedural code will be executed on every call**. The most common error here
-is putting a test.php/phpinfo.php file in the document root. See [datamodel](/developer_guides/model/data_model_and_orm) and [controllers](/developer_guides/controllers)
-for ways how to structure your code.
-
-Also, please check that you have PHP enabled on the webserver, and you're running PHP 5.1 or later.
-The web-based [SilverStripe installer](/getting_started/installation) can help you with this.
-
-## I've got file permission problems during installation
-
-The php installer needs to be able to write files during installation, which should be restricted again afterwards. It
-needs to create/have write-access to:
-
- * The main installation directory (for creating .htaccess file and assets directory)
- * The `app/` folder (to create _config.php)
- * After the install, the assets directory is the only directory that needs write access.
- * Image thumbnails will not show in the CMS if permission is not given
-
-If you are running on a server instance where users other than the webserver user will need
-read / write access to files in the assets folder, then you should do one of the below:
-
- - Ensure that all server users that modify this file belong to the same group
- - Modify the permissions that SilverStripe uses to write to a more permissive setting (see below)
-
-It may be necessary to manually set the original permissions, and owner user/group of your assets folder on
-initial deployment.
-
-For more information on understanding and determining file permissions, please see
-[wikipedia](https://en.wikipedia.org/wiki/File_system_permissions#Traditional_Unix_permissions)
-on unix permissions.
-
-### Modifying write permissions of files
-
-By default all files and `.htaccess` are written with permission `0664`.
-You could enable other users to access these files with the below config.
-Note: Please adjust the values below to those appropriate for your server configuration.
-You may require `0666` for combined files generated during requests where they are cleared or refreshed only during a flush.
-
-*app/_config/assetperms.yml*
-
-```yaml
----
-Name: myassetperms
----
-SilverStripe\Assets\Flysystem\AssetAdapter:
- file_permissions:
- file:
- public: 0666 # Replace with your desired permission for files
- dir:
- public: 0777 # Replace with your desired permission for folders
-```
-
-Note: `public` key applies to all files whether they are protected or public; This is a flag internal to
-Flysystem, and file protection is applied by SilverStripe on top of these permissions.
-
-## I have whitespace before my HTML output, triggering quirks mode or preventing cookies from being set
-
-SilverStripe only uses class declarations in PHP files, and doesn't output any content
-directly outside of these declarations. It's easy to accidentally add whitespace
-or any other characters before the `` closing braket at the end of the document.
-
-Since we're dealing with hundreds of included files, identifying these mistakes manually can be tiresome.
-The best way to detect whitespace is to look through your version control system for any uncommitted changes.
-If that doesn't work out, here's a little script to run checks in all relevant PHP files.
-Save it as `check.php` into your webroot, and run it as `php check.php` (or open it in your browser).
-After using the script (and fixing errors afterwards), please remember to remove it again.
-
-```php
-// Check for whitespace around PHP brackets which show in output,
-// and hence can break HTML rendering and HTTP operations.
-$path = dirname(__FILE__);
-$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
-$matched = false;
-foreach($files as $name => $file){
- if($file->getExtension() != 'php') continue;
- if(preg_match('/thirdparty|vendor/',$file->getPathname())) continue;
- $content = file_get_contents($file->getPathname());
- if(preg_match('/^[[:blank:]]+<\?' . 'php/', $content)) {
- echo sprintf("%s: Space before opening bracket\n", $file->getPathname());
- $matched = true;
- }
- if(preg_match('/^\?' . '>\n?[[:blank:]]+/m', $content)) {
- echo sprintf("%s: Space after closing bracket\n", $file->getPathname());
- $matched = true;
- }
-}
-```
diff --git a/docs/en/00_Getting_Started/index.md b/docs/en/00_Getting_Started/index.md
index db11fc55f..c53626b68 100644
--- a/docs/en/00_Getting_Started/index.md
+++ b/docs/en/00_Getting_Started/index.md
@@ -1,5 +1,8 @@
+---
title: Getting Started
introduction: SilverStripe is a web application. This means that you will need to have a webserver and database. We will take you through the setup of the server environment as well the application itself.
+icon: rocket
+---
## Server Requirements
@@ -45,6 +48,11 @@ Webserver setup is covered in
[Lesson 4: Setting up a local dev environment](https://www.silverstripe.org/learn/lessons/v4/up-and-running-setting-up-a-local-silverstripe-dev-environment-1)
+
+## Keep learning
+
+[CHILDREN]
+
## Troubleshooting
If you run into trouble, see [common-problems](common_problems) or
diff --git a/docs/en/01_Lessons/index.md b/docs/en/01_Lessons/index.md
index 2d6bee8f8..44f944db0 100644
--- a/docs/en/01_Lessons/index.md
+++ b/docs/en/01_Lessons/index.md
@@ -1,5 +1,8 @@
+---
title: Lessons
introduction: The lessons take a step by step look at how to build a SilverStripe application.
+icon: graduation-cap
+---
* [How to set up a local development environment in SilverStripe](https://www.silverstripe.org/learn/lessons/v4/up-and-running-setting-up-a-local-silverstripe-dev-environment-1)
* [Lesson 1: Creating your first project](https://www.silverstripe.org/learn/lessons/v4/creating-your-first-project)
diff --git a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md
index 08ccc6c14..2282794da 100644
--- a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md
+++ b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md
@@ -1,5 +1,8 @@
+---
title: Introduction to the Data Model and ORM
summary: Introduction to creating and querying a database records through the ORM (object-relational model)
+icon: database
+---
# Introduction to the Data Model and ORM
@@ -60,10 +63,10 @@ It **won't** do any of the following
their table names don't match a SilverStripe data class.
-
+[notice]
You need to be logged in as an administrator to perform this command, unless your site is in [dev mode](../debugging),
or the command is run through [CLI](../cli).
-
+[/notice]
When rebuilding the database schema through the [ClassLoader](api:SilverStripe\Core\Manifest\ClassLoader) the following additional properties are
automatically set on the `DataObject`.
@@ -121,9 +124,9 @@ Or, a better way is to use the `create` method.
$player = Player::create();
```
-
+[notice]
Using the `create()` method provides chainability, which can add elegance and brevity to your code, e.g. `Player::create()->write()`. More importantly, however, it will look up the class in the [Injector](../extending/injector) so that the class can be overriden by [dependency injection](http://en.wikipedia.org/wiki/Dependency_injection).
-
+[/notice]
Database columns and properties can be set as class properties on the object. The SilverStripe ORM handles the saving
@@ -179,9 +182,9 @@ $members = Player::get()->filter([
```
-
+[info]
Provided `filter` values are automatically escaped and do not require any escaping.
-
+[/info]
## Lazy Loading
@@ -440,11 +443,11 @@ $teams = Team::get()->filter('Players.Sum(PointsScored):LessThan', 300);
It is also possible to filter by a PHP callback, this will force the data model to fetch all records and loop them in
PHP, thus `filter()` or `filterAny()` are to be preferred over `filterByCallback()`.
-
+[notice]
Because `filterByCallback()` has to run in PHP, it has a significant performance tradeoff, and should not be used on large recordsets.
`filterByCallback()` will always return an `ArrayList`.
-
+[/notice]
The first parameter to the callback is the item, the second parameter is the list itself. The callback will run once
for each record, if the callback returns true, this record will be added to the list of returned items.
@@ -552,9 +555,9 @@ offset, if not provided as an argument, will default to 0.
$members = Member::get()->sort('Surname')->limit(10, 4);
```
-
+[alert]
Note that the `limit` argument order is different from a MySQL LIMIT clause.
-
+[/alert]
### Mapping classes to tables with DataObjectSchema
@@ -653,10 +656,10 @@ $members = Member::get()
->innerJoin("Group_Members", "\"Rel\".\"MemberID\" = \"Member\".\"ID\"", "Rel");
```
-
+[alert]
Passing a *$join* statement to will filter results further by the JOINs performed against the foreign table. It will
**not** return the additionally joined data.
-
+[/alert]
### Default Values
@@ -675,10 +678,10 @@ class Player extends DataObject
}
```
-
+[notice]
Note: Alternatively you can set defaults directly in the database-schema (rather than the object-model). See
[Data Types and Casting](/developer_guides/model/data_types_and_casting) for details.
-
+[/notice]
## Subclasses
diff --git a/docs/en/02_Developer_Guides/00_Model/02_Relations.md b/docs/en/02_Developer_Guides/00_Model/02_Relations.md
index 589194976..a796426bb 100644
--- a/docs/en/02_Developer_Guides/00_Model/02_Relations.md
+++ b/docs/en/02_Developer_Guides/00_Model/02_Relations.md
@@ -1,5 +1,8 @@
+---
title: Relations between Records
summary: Relate models together using the ORM using has_one, has_many, and many_many.
+icon: link
+---
# Relations between Records
@@ -115,19 +118,19 @@ class Fan extends DataObject
}
```
-
+[warning]
Note: The use of polymorphic relationships can affect query performance, especially
on joins, and also increases the complexity of the database and necessary user code.
They should be used sparingly, and only where additional complexity would otherwise
be necessary. E.g. Additional parent classes for each respective relationship, or
duplication of code.
-
+[/warning]
## has_many
Defines 1-to-many joins. As you can see from the previous example, `$has_many` goes hand in hand with `$has_one`.
-
+[alert]
Please specify a $has_one-relationship on the related child-class as well, in order to have the necessary accessors
available on both ends. To add a $has_one-relationship on core classes, yml config settings can be used:
```yml
@@ -135,7 +138,7 @@ SilverStripe\Assets\Image:
has_one:
MyDataObject: MyDataObject
```
-
+[/alert]
```php
use SilverStripe\ORM\DataObject;
@@ -246,10 +249,10 @@ Defines many-to-many joins, which uses a third table created between the two to
There are two ways in which this can be declared, which are described below, depending on
how the developer wishes to manage this join table.
-
+[warning]
Please specify a $belongs_many_many-relationship on the related class as well, in order
to have the necessary accessors available on both ends.
-
+[/warning]
Much like the `has_one` relationship, `many_many` can be navigated through the `ORM` as well.
The only difference being you will get an instance of [ManyManyList](api:SilverStripe\ORM\ManyManyList) or
@@ -511,10 +514,10 @@ If your object is versioned, cascade_deletes will also act as "cascade unpublish
on a parent object will trigger unpublish on the child, similarly to how `owns` causes triggered publishing.
See the [versioning docs](/developer_guides/model/versioning) for more information on ownership.
-
+[alert]
Declaring cascade_deletes implies delete permissions on the listed objects.
Built-in controllers using delete operations check canDelete() on the owner, but not on the owned object.
-
+[/alert]
## Cascading duplications
@@ -597,10 +600,10 @@ class Team extends DataObject
```
-
+[notice]
Adding new records to a filtered `RelationList` like in the example above doesn't automatically set the filtered
criteria on the added record.
-
+[/notice]
## Relations on Unsaved Objects
diff --git a/docs/en/02_Developer_Guides/00_Model/03_Lists.md b/docs/en/02_Developer_Guides/00_Model/03_Lists.md
index a5d56cc8a..4d0553481 100644
--- a/docs/en/02_Developer_Guides/00_Model/03_Lists.md
+++ b/docs/en/02_Developer_Guides/00_Model/03_Lists.md
@@ -1,5 +1,8 @@
+---
title: Managing Lists
summary: The SS_List interface allows you to iterate through and manipulate a list of objects.
+icon: list
+---
# Managing Lists
diff --git a/docs/en/02_Developer_Guides/00_Model/04_Data_Types_and_Casting.md b/docs/en/02_Developer_Guides/00_Model/04_Data_Types_and_Casting.md
index 0d7f8c633..4c3f6b153 100644
--- a/docs/en/02_Developer_Guides/00_Model/04_Data_Types_and_Casting.md
+++ b/docs/en/02_Developer_Guides/00_Model/04_Data_Types_and_Casting.md
@@ -1,5 +1,8 @@
+---
title: Data Types, Overloading and Casting
summary: Learn how how data is stored going in and coming out of the ORM and how to modify it.
+icon: code
+---
# Data Types and Casting
diff --git a/docs/en/02_Developer_Guides/00_Model/05_Extending_DataObjects.md b/docs/en/02_Developer_Guides/00_Model/05_Extending_DataObjects.md
index 5128306ea..0a413e859 100644
--- a/docs/en/02_Developer_Guides/00_Model/05_Extending_DataObjects.md
+++ b/docs/en/02_Developer_Guides/00_Model/05_Extending_DataObjects.md
@@ -1,5 +1,7 @@
+---
title: Extending DataObjects
summary: Modify the data model without using subclasses.
+---
# Extending DataObjects
@@ -85,10 +87,10 @@ class Player extends DataObject
}
```
-
+[notice]
Note: There are no separate methods for *onBeforeCreate* and *onBeforeUpdate*. Please check `$this->isInDb()` to toggle
these two modes, as shown in the example above.
-
+[/notice]
## Related Lessons
* [Working with data relationships - $has_many](https://www.silverstripe.org/learn/lessons/v4/working-with-data-relationships-has-many-1)
diff --git a/docs/en/02_Developer_Guides/00_Model/06_SearchFilters.md b/docs/en/02_Developer_Guides/00_Model/06_SearchFilters.md
index 2fd1131c9..b5072f8e0 100644
--- a/docs/en/02_Developer_Guides/00_Model/06_SearchFilters.md
+++ b/docs/en/02_Developer_Guides/00_Model/06_SearchFilters.md
@@ -1,5 +1,8 @@
+---
title: SearchFilter Modifiers
summary: Use suffixes on your ORM queries.
+icon: search
+---
# SearchFilter Modifiers
diff --git a/docs/en/02_Developer_Guides/00_Model/07_Permissions.md b/docs/en/02_Developer_Guides/00_Model/07_Permissions.md
index a543f22b9..9f07c7159 100644
--- a/docs/en/02_Developer_Guides/00_Model/07_Permissions.md
+++ b/docs/en/02_Developer_Guides/00_Model/07_Permissions.md
@@ -1,5 +1,8 @@
+---
title: Model-Level Permissions
summary: Reduce risk by securing models.
+icon: lock
+---
# Model-Level Permissions
@@ -11,10 +14,10 @@ The API provides four methods for this purpose: `canEdit()`, `canCreate()`, `can
Since they're PHP methods, they can contain arbitrary logic matching your own requirements. They can optionally receive
a `$member` argument, and default to the currently logged in member (through `Security::getCurrentUser()`).
-
+[notice]
By default, all `DataObject` subclasses can only be edited, created and viewed by users with the 'ADMIN' permission
code.
-
+[/notice]
```php
use SilverStripe\Security\Permission;
@@ -44,11 +47,11 @@ class MyDataObject extends DataObject
}
```
-
+[alert]
These checks are not enforced on low-level ORM operations such as `write()` or `delete()`, but rather rely on being
checked in the invoking code. The CMS default sections as well as custom interfaces like [ModelAdmin](api:SilverStripe\Admin\ModelAdmin) or
[GridField](api:SilverStripe\Forms\GridField\GridField) already enforce these permissions.
-
+[/alert]
## API Documentation
diff --git a/docs/en/02_Developer_Guides/00_Model/08_SQL_Select.md b/docs/en/02_Developer_Guides/00_Model/08_SQL_Select.md
index 7cc0650b4..1ceaf594e 100644
--- a/docs/en/02_Developer_Guides/00_Model/08_SQL_Select.md
+++ b/docs/en/02_Developer_Guides/00_Model/08_SQL_Select.md
@@ -1,5 +1,8 @@
+---
title: SQL Queries
summary: Write and modify direct database queries through SQLExpression subclasses.
+iconBrand: searchengin
+---
# SQLSelect
@@ -46,10 +49,10 @@ various assumptions the ORM and code based on it have:
We'll explain some ways to use *SELECT* with the full power of SQL,
but still maintain a connection to the ORM where possible.
-
+[warning]
Please read our [security topic](/developer_guides/security) to find out
how to properly prepare user input and variables for use in queries
-
+[/warning]
## Usage
diff --git a/docs/en/02_Developer_Guides/00_Model/09_Validation.md b/docs/en/02_Developer_Guides/00_Model/09_Validation.md
index c8605d7e0..96a4f9d32 100644
--- a/docs/en/02_Developer_Guides/00_Model/09_Validation.md
+++ b/docs/en/02_Developer_Guides/00_Model/09_Validation.md
@@ -1,5 +1,8 @@
+---
title: Model Validation and Constraints
summary: Validate your data at the model level
+icon: check-square
+---
# Validation and Constraints
diff --git a/docs/en/02_Developer_Guides/00_Model/10_Versioning.md b/docs/en/02_Developer_Guides/00_Model/10_Versioning.md
index d306eeed8..e989432ed 100644
--- a/docs/en/02_Developer_Guides/00_Model/10_Versioning.md
+++ b/docs/en/02_Developer_Guides/00_Model/10_Versioning.md
@@ -1,5 +1,7 @@
+---
title: Versioning
summary: Add versioning to your database content through the Versioned extension.
+---
# Versioning
@@ -11,7 +13,7 @@ from published content shown to your website visitors.
Versioning in SilverStripe is handled through the [Versioned](api:SilverStripe\Versioned\Versioned) class. As a [DataExtension](api:SilverStripe\ORM\DataExtension) it is possible to be applied to any [DataObject](api:SilverStripe\ORM\DataObject) subclass. The extension class will automatically update read and write operations done via the ORM via the `augmentSQL` database hook.
-
+[notice]
There are two complementary modules that improve content editor experience around "owned" nested objects (e.g. elemental blocks).
Those are in experimental status right now, but we would appreciate any feedback and contributions.
@@ -25,7 +27,7 @@ The second module extends CMS History UI adding control over nested objects.
![](../../_images/snapshot-admin.png)
*Example screenshot from versioned-snapshot-admin*
-
+[/notice]
## Understanding versioning concepts
@@ -63,11 +65,11 @@ SilverStripe makes this possible by using the concept of _cascade publishing_. Y
A non-recursive publish operation is also available if you want to publish a new version of a object without cascade publishing all its children.
-
+[alert]
Declaring ownership implies publish permissions on owned objects.
Built-in controllers using cascading publish operations check canPublish()
on the owner, but not on the owned object.
-
+[/alert]
#### Ownership of unversioned object
@@ -92,11 +94,11 @@ Changes to many objects can be grouped together using the [`ChangeSet`](api:Silv
Records can be added to a changeset in the CMS by using the "Add to campaign" button
that is available on the edit forms of all pages and files. Programmatically, this is done by creating a `SilverStripe\Versioned\ChangeSet` object and invoking its `addObject(DataObject $record)` method.
-
+[info]
DataObjects can be added to more than one ChangeSet.
Most of the time, these objects contain changes.
A ChangeSet can contain unchanged objects as well.
-
+[/info]
#### Implicit vs. Explicit inclusions
@@ -144,15 +146,15 @@ class VersionedModel extends DataObject
}
```
-
+[notice]
The extension is automatically applied to `SiteTree` class. For more information on extensions see
-[Extending](../extending) and the [Configuration](../configuration) documentation.
-
+extending and the Configuration documentation.
+[/notice]
-
+[warning]
Versioning only works if you are adding the extension to the base class. That is, the first subclass
of `DataObject`. Adding this extension to children of the base class will have unpredictable behaviour.
-
+[/warning]
### Defining ownership between related versioned DataObjects
@@ -344,10 +346,10 @@ use SilverStripe\Versioned\Versioned;
$historicalRecord = Versioned::get_version('MyRecord', , );
```
-
+[alert]
The record is retrieved as a `DataObject`, but saving back modifications via `write()` will create a new version,
rather than modifying the existing one.
-
+[/alert]
In order to get a list of all versions for a specific record, we need to generate specialized [Versioned_Version](api:SilverStripe\Versioned\Versioned_Version)
objects, which expose the same database information as a `DataObject`, but also include information about when and how
@@ -512,10 +514,10 @@ Depending on whether staging is enabled, one or more new tables will be created
is always created to track historic versions for your model. If staging is enabled this will also create a new
`_Live` table once you've rebuilt the database.
-
+[notice]
Note that the "Stage" naming has a special meaning here, it will leave the original table name unchanged, rather than
adding a suffix.
-
+[/notice]
* `MyRecord` table: Contains staged data
* `MyRecord_Live` table: Contains live data
@@ -682,22 +684,22 @@ SilverStripe\Control\Director:
'my-objects/$ID': 'MyObjectController'
```
-
+[alert]
The `choose_site_stage()` call only deals with setting the default stage, and doesn't check if the user is
authenticated to view it. As with any other controller logic, please use `DataObject->canView()` to determine
permissions, and avoid exposing unpublished content to your users.
-
+[/alert]
### Controlling permissions to versioned DataObjects
By default, `Versioned` will come out of the box with security extensions which restrict the visibility of objects in Draft (stage) or Archive viewing mode.
-
+[alert]
As is standard practice, user code should always invoke `canView()` on any object before
rendering it. DataLists do not filter on `canView()` automatically, so this must be
-done via user code. This be be achieved either by wrapping `<% if $canView %>` in
+done via user code. This be be achieved either by wrapping `<% if $canView %>;` in
your template, or by implementing your visibility check in PHP.
-
+[/alert]
#### Version specific _can_ methods
@@ -845,7 +847,7 @@ public function init()
SilverStripe will usually call these low level methods for you when you. However if you have specialised needs, you may call them directly.
-To move a saved version from one stage to another, call [writeToStage()](api:SilverStripe\Versioned\Versioned::writeToStage()) on the object. This is used internally to publish DataObjects.
+To move a saved version from one stage to another, call [writeToStage(stage)](api:SilverStripe\Versioned\Versioned::writeToStage()) on the object. This is used internally to publish DataObjects.
`copyVersionToStage($versionID, $stage)` allow you to restore a previous version to a specific stage. This is used internally when performing a rollback.
diff --git a/docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md b/docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md
index 2706e7a48..82294d372 100644
--- a/docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md
+++ b/docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md
@@ -1,5 +1,8 @@
+---
title: Building Model and Search Interfaces around Scaffolding
summary: A Model-driven approach to defining your application UI.
+icon: hammer
+---
# Scaffolding
diff --git a/docs/en/02_Developer_Guides/00_Model/12_Indexes.md b/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
index 95bc1b472..3cb6b7ae9 100644
--- a/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
+++ b/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
@@ -1,5 +1,8 @@
+---
title: Indexes
summary: Add Indexes to your Data Model to optimize database queries.
+icon: database
+---
# Indexes
Indexes are a great way to improve performance in your application, especially as it grows. By adding indexes to your
@@ -69,10 +72,10 @@ class MyTestObject extends DataObject
}
```
-
+[alert]
Please note that if you have previously used the removed `value` key to define an index's contents, SilverStripe will
now throw an error. Use `columns` instead.
-
+[/alert]
## Complex/Composite Indexes
For complex queries it may be necessary to define a complex or composite index on the supporting object. To create a
diff --git a/docs/en/02_Developer_Guides/00_Model/How_Tos/Dynamic_Default_Fields.md b/docs/en/02_Developer_Guides/00_Model/How_Tos/Dynamic_Default_Fields.md
index 0fa9464f2..6d8c2b7ba 100644
--- a/docs/en/02_Developer_Guides/00_Model/How_Tos/Dynamic_Default_Fields.md
+++ b/docs/en/02_Developer_Guides/00_Model/How_Tos/Dynamic_Default_Fields.md
@@ -1,3 +1,8 @@
+---
+title: Dynamic Default Fields
+summary: Learn how to add default values to your models
+---
+
# Default Values and Records
## Static Default Values
diff --git a/docs/en/02_Developer_Guides/00_Model/How_Tos/Grouping_DataObject_Sets.md b/docs/en/02_Developer_Guides/00_Model/How_Tos/Grouping_DataObject_Sets.md
index 59ea486b5..f30038190 100644
--- a/docs/en/02_Developer_Guides/00_Model/How_Tos/Grouping_DataObject_Sets.md
+++ b/docs/en/02_Developer_Guides/00_Model/How_Tos/Grouping_DataObject_Sets.md
@@ -1,3 +1,8 @@
+---
+title: Grouping DataObject sets
+summary: Learn how to split the results of a query into subgroups
+---
+
# Grouping lists of records
The [SS_List](api:SilverStripe\ORM\SS_List) class is designed to return a flat list of records.
diff --git a/docs/en/02_Developer_Guides/00_Model/How_Tos/index.md b/docs/en/02_Developer_Guides/00_Model/How_Tos/index.md
new file mode 100644
index 000000000..29eb663e5
--- /dev/null
+++ b/docs/en/02_Developer_Guides/00_Model/How_Tos/index.md
@@ -0,0 +1,6 @@
+---
+title: How To's
+---
+# How To's: Model and Databases
+
+[CHILDREN]
\ No newline at end of file
diff --git a/docs/en/02_Developer_Guides/00_Model/index.md b/docs/en/02_Developer_Guides/00_Model/index.md
index 0f2516cfc..1d17da604 100644
--- a/docs/en/02_Developer_Guides/00_Model/index.md
+++ b/docs/en/02_Developer_Guides/00_Model/index.md
@@ -1,6 +1,9 @@
+---
title: Model and Databases
summary: Learn how SilverStripe manages database tables, ways to query your database and how to publish data.
introduction: This guide will cover how to create and manipulate data within SilverStripe and how to use the ORM (Object Relational Model) to query data.
+icon: database
+---
In SilverStripe, application data will be represented by a [DataObject](api:SilverStripe\ORM\DataObject) class. A `DataObject` subclass defines the
data columns, relationships and properties of a particular data record. For example, [Member](api:SilverStripe\Security\Member) is a `DataObject`
diff --git a/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md b/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md
index 4c0a7cb13..cf072aed9 100644
--- a/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md
+++ b/docs/en/02_Developer_Guides/01_Templates/01_Syntax.md
@@ -1,5 +1,8 @@
+---
title: Template Syntax
summary: A look at the operations, variables and language controls you can use within templates.
+icon: code
+---
# Template Syntax
@@ -40,10 +43,10 @@ An example of a SilverStripe template is below: