Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Namespaces and removes reference to TranslatableCatalogExtension #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 22 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ $ composer require littlegiant/silverstripe-catalogmanager
Add the following to a configuration yml file:

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- CatalogParentPage
- MyNamespace\MyCatalogParentPage
```

Where `CatalogPage` is the page type you wish to administer (e.g. BlogEntry) and `CatalogParentPage` is where the pages
Expand All @@ -34,9 +34,9 @@ will provide users with a drop down to choose which page should be the parent.
You can also create pages in the root of the project (i.e. ParentID = 0) by not providing a parent class.

```yml
LandingPage:
MyNamespace\MyLandingPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
```

Then simply extend `CatalogPageAdmin` instead of `ModelAdmin`.
Expand All @@ -45,43 +45,32 @@ Then simply extend `CatalogPageAdmin` instead of `ModelAdmin`.

You can also manage DataObjects through the `CatalogDataObjectExtension`

### Translations

If you are using the translatable module, you can use the TranslatableCatalogExtension to provide functionality for
choosing languages.

```yml
CatalogPageAdmin:
extensions:
- TranslatableCatalogExtension
```

### Options

#### Hide pages in CMS

When managing pages with catalogmanager you might want to hide this pages in CMS. You can do this by adding the `HidePageChildrenExtension` to the holder page, e.g.

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- 'CatalogParentPage'
CatalogParentPage:
- MyNamespace\MyCatalogParentPage
MyNamespace\MyCatalogParentPage:
extensions:
- HidePageChildrenExtension
- LittleGiant\CatalogManager\Extensions\HidePageChildrenExtension
```

#### Duplication of pages
You can disable the ability to duplicate pages through the `can_duplicate` configuration setting per object.

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- 'CatalogParentPage'
- MyNamespace\MyCatalogParentPage
can_duplicate: false
```

Expand All @@ -91,34 +80,34 @@ You can add drag and drop sorting using GridFieldSortableRows when you add the `
Uses column `Sort` by default which is default in SiteTree and is added by CatalogDataObjectExtension.

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- 'CatalogParentPage'
- MyNamespace\MyCatalogParentPage
sort_column: 'CustomSort'
```

If you want to disable drag and drop sorting just set `sort_column` to false

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- 'CatalogParentPage'
- MyNamespace\MyCatalogParentPage
sort_column: false
```

Sort columns automatically update the sort column of both the staged and live versions of the object. To disable this,
you can set the configuration option `automatic_live_sort` to false through your config.

```yml
CatalogPage:
MyNamespace\MyCatalogPage:
extensions:
- CatalogPageExtension
- LittleGiant\CatalogManager\Extensions\CatalogPageExtension
parent_classes:
- 'CatalogParentPage'
- MyNamespace\MyCatalogParentPage
automatic_live_sort: false
```

Expand Down