mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge pull request #51 from xini/1.0
Front end sorting of documents - Fixes #44
This commit is contained in:
commit
da642ddaf3
@ -31,7 +31,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
|||||||
'FilenameWithoutID'=>'Filename',
|
'FilenameWithoutID'=>'Filename',
|
||||||
'LastChanged'=>'LastChanged'
|
'LastChanged'=>'LastChanged'
|
||||||
);
|
);
|
||||||
|
|
||||||
static $singular_name = 'Document';
|
static $singular_name = 'Document';
|
||||||
|
|
||||||
static $plural_name = 'Documents';
|
static $plural_name = 'Documents';
|
||||||
|
@ -113,9 +113,9 @@ class DMSSiteTreeExtension extends DataExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overloaded to enforce sorting
|
* Enforce sorting for frontend
|
||||||
*/
|
*/
|
||||||
function Documents() {
|
function PageDocuments() {
|
||||||
return $this->owner->getManyManyComponents('Documents')->sort('DocumentSort');
|
return $this->owner->getManyManyComponents('Documents')->sort('DocumentSort');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<% if Documents %>
|
<% if PageDocuments %>
|
||||||
<div><h3>Documents:</h3></div>
|
<div><h3>Documents:</h3></div>
|
||||||
<% loop Documents %><% include Document %><% end_loop %>
|
<% loop PageDocuments %><% include Document %><% end_loop %>
|
||||||
<% end_if %>
|
<% end_if %>
|
Loading…
Reference in New Issue
Block a user