Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Feb 24, 2020
1 parent 60c6b23 commit 5efdb6a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ env:

matrix:
include:
- php: 5.6
- php: 7.1
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
- php: 7.1
env: DB=PGSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_COVERAGE_TEST=1
Expand Down
12 changes: 12 additions & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ Symbiote\GridFieldExtensions\GridFieldAddNewMultiClassHandler:
SilverStripe\Core\Injector\Injector:
SilverStripe\CMS\Controllers\CMSSiteTreeFilter_Search:
class: DNADesign\Elemental\Controllers\ElementSiteTreeFilterSearch

DNADesign\Elemental\Models\BaseElement:
extensions:
topPage: DNADesign\Elemental\TopPage\DataExtension

DNADesign\Elemental\Models\ElementalArea:
extensions:
topPage: DNADesign\Elemental\TopPage\DataExtension

Page:
extensions:
- DNADesign\Elemental\TopPage\SiteTreeExtension
32 changes: 5 additions & 27 deletions docs/en/advanced_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ FluentState::singleton()->withState(function (FluentState $state) {
This is very important as global state is reverted back after the callback is executed so it's safe to be used.
Unit tests benefit mostly from this as this makes sure that there are no dependencies between unit tests as the global state is always changed only locally in one test.

## Top page reference feature (optional performance improvement)
## Top page reference feature

In some cases your project setup may have deeply nested blocks, for example:

Expand All @@ -299,41 +299,19 @@ Most common cases are:

This module uses some in-memory caching but this isn't good enough for such deeply nested data structures by default.

In such cases it is recommended to turn on this feature which stores the top page reference on individual blocks and elemental areas.
In such cases it is recommended to use this feature which stores the top page reference on individual blocks and elemental areas.
This speeds up data lookup significantly.

Please note that this feature only works correctly in Elemental configurations that don't allow direct block sharing, i.e. where each Element belongs to a single ElementalArea / Page.

To turn the feature on, apply the following extensions:

```
DNADesign\Elemental\Models\BaseElement:
extensions:
- DNADesign\Elemental\TopPage\DataExtension
DNADesign\Elemental\Models\ElementalArea:
extensions:
- DNADesign\Elemental\TopPage\DataExtension
Page:
extensions:
- DNADesign\Elemental\TopPage\SiteTreeExtension
```

If your project makes use of the Fluent module, it is recommended to use the following extensions instead:
If your project makes use of the Fluent module, it is recommended to use the following extensions to replace the ones used by default:

```
DNADesign\Elemental\Models\BaseElement:
extensions:
- DNADesign\Elemental\TopPage\FluentExtension
topPage: DNADesign\Elemental\TopPage\FluentExtension
DNADesign\Elemental\Models\ElementalArea:
extensions:
- DNADesign\Elemental\TopPage\FluentExtension
Page:
extensions:
- DNADesign\Elemental\TopPage\SiteTreeExtension
topPage: DNADesign\Elemental\TopPage\FluentExtension
```

This will store the locale of the top page on blocks which simplifies top page lookup in case the locale is unknown at the time of page lookup from block context.
Expand Down

0 comments on commit 5efdb6a

Please sign in to comment.