silverstripe-dms/docs/en/manage-page-relations.md

11 lines
219 B
Markdown

# Manage page relations
To find documents by a Page:
```php
$dms = DMS::getDMSInstance();
$page = SiteTree::get()->filter('URLSegment', 'home')->first();
/** @var DataList $docs */
$docs = $dms->getByPage($page);
```