fix front end sorting of documents

fixes #44 for 1.0 branch
This commit is contained in:
Florian Thoma 2014-07-22 13:07:57 +10:00
parent e862e02cf1
commit ec0ecdda6d
3 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
'FilenameWithoutID'=>'Filename',
'LastChanged'=>'LastChanged'
);
static $singular_name = 'Document';
static $plural_name = 'Documents';

View File

@ -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');
}

View File

@ -1,4 +1,4 @@
<% if Documents %>
<% if PageDocuments %>
<div><h3>Documents:</h3></div>
<% loop Documents %><% include Document %><% end_loop %>
<% loop PageDocuments %><% include Document %><% end_loop %>
<% end_if %>