Sort documents on front-end - Fixes #44

This commit is contained in:
Stephen Shkardoon 2015-02-03 15:54:06 +13:00
parent 8638440660
commit 3453e51255
2 changed files with 5 additions and 5 deletions

View File

@ -119,9 +119,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');
} }

View File

@ -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 %>