Document Management System Module

Posted by Julian Seidenberg on 21 November 2012

I have the pleasure of introducing a new module that we created here at the SilverStripe HQ - The Document Management System (DMS) module. 


A few years ago, community member Aaron Calino (UncleCheese) created the Data Object Manager module for SilverStripe 2. This module was packed with features that allowed users to manage DataObjects related to pages. However, as Aaron has stated in this forum post, the new GridField class in SilverStripe 3 does much of what Data Object Manager did in SS2, so he won't be making a version of Data Object Manager for SS3.

We found ourselves needing something similar to the old Data Object Manager module in one of our recent SS3 projects. We took this opportunity to create a great new open source module, a module built in the same spirit as the Data Object Manager, built on SS3 from the ground up, and built to serve as the basis for sophisticated Document Management with SilverStripe now and in the future.

Design goals

We had several goals in mind when designing the DMS module:

  • Painless association of files with pages
  • Simple, clear and reliable file storage system
  • Extensible and customisable architecture
  • Easy UI for uploading, replacing, and linking files

The first item in the list needs some explanation. Traditionally, SilverStripe has a "Files and Images" section where you upload files, then add these files to your page when you need them. This has the advantage that you can easily reuse a single file on multiple pages. However, more often than not, you will only ever need a file uploaded to a single page, and having to separately upload the file into "Files and Images" unnecessarily complicates the process. Additionally, if you want to replace a file with a new version, finding the underlying file from a reference on a page can quickly become tedious.

Our solution is to directly associate files with the pages, skipping the "Files and Images" section completely. We then polish the process for doing so to make it as smooth, reliable, and painless as possible.

The files themselves are stored in a folder structure under a new "dms-assets" folder. We intentionally preserve the filename of each file (as opposed to hashing names) to make it easier to find your file again in case something goes wrong. We do, however, add the database ID number to each filename, so that the link to the database record is obvious and extremely fault-tolerant. We use a number of folders for the files, so that all the files don't just end up in one gigantic folder. You can configure how many files go into each folder to suit your deployment.

In case you're wondering about the scaleability of the DMS module. We are currently using the DMS in production with tens of thousands of documents and it doesn't even break a sweat.

Feature walkthrough

Here is a walk-through of some features of the DMS module:

adding documents

When you first install the DMS module, every page in the CMS gets a new "documents" tab. On that tab you can click the "Add Documents" button, which takes you to the screen above.

Uploading is really easy. You just drag and drop (in modern browsers), and/or select files with a dialog box. Immediately after you upload files, you get the opportunity to either edit each file's metadata, or just click "Done" to go back to the page you were on.

linking documentsYou can also link documents from other pages. You do this either by typing in an autocomplete search field (referencing files by name and/or ID), or by clicking the "Browser by page" button to get a TreeDropDown view of the page structure. The linked document appears on the current page, as well as the page where it was originally uploaded.

You can link any document in the DMS to any page. A document does not "belong" to a specific page. For example, if you upload a document to Page-A, then link it to Page-B, then delete the document from Page-A, the document will stay on Page-B, as if nothing had happened. Reference counting keeps track of everything.

dms gridHere is the DMS grid (powered by the SS3 GridField). It allows you to do a quick download, go to the detailed edit view, and delete or unlink the current file (if a file is only attached to a single page, then you get a "delete" button; otherwise, if the same file is attached to multiple pages, you get an "unlink" button). You can filter/search the grid by clicking on the "magnifying glass" button in the top-right corner.

You can also sort the list of files in the grid with drag-and-drop if you drop in this SortableGridField module. Similarly, the "Show all" button on the footer appears if you install this GridFieldPaginator module. Both are nice demos for how you can easily extend the functionality of the DMS with add-on modules.

dms edit

The Detailed Editor view gives you the ability to view and edit a document's metadata. The DMS also has embargo and expiry built into it. So you can schedule documents to appear or disappear at a specific date. You can replace a document using drag-and-drop. "Find usage" shows other pages where the current document has been linked. "Find references" shows you pages where the current document has been referenced in the HTML content (more on that later). Finally, "Delete" deletes the document from this page and all other pages where it is used, giving you a warning pop-up before proceeding.

dms edit

This feature of the DMS allows you to insert a link to a DMS document into the HTML content of a page. The DMS adds a new option to the CMS link editor. You can use the combined auto-complete-search/PageTree-browse view to find the document you want to link to and insert the link. Again, reference tracking keeps track of each link you add and allows you to view where each document is linked in the Detail View.

dms front-end

Finally, there has to be a way to display the documents in the website front-end, right? Of course there is. That requires a small change to your template. Just add <% include Documents %> to the template wherever you want the documents to appear. That will give you a document listing similar to the one in the screenshot above.

Start using the DMS and contribute

We hope you like the new DMS module. Please try it out. Like all of SilverStripe, it is open-sourced using a BSD license. Click to download the Document Management System module.

We are keen to hear your feedback. If you have an idea for improving the module, please discuss it in the forum, or send us a github pull-request. Here are some ideas we have thought of already:

  • You can add a search box to your site that searches through the full-text of all documents using the fulltext-search module.
  • We are currently working on a simple method of versioning the files in the DMS. So, if you replace a document, the previous versions of that document are kept for archival purposes. This is coming soon.
  • A new feature we are thinking about adding is a view that shows you all the documents in the DMS in a single view, a view you can use to conveniently search and edit all documents in the system. However, it might take a while until we get to doing this.


Post your comment

Note: Comments are moderated and won't show until they are approved


  • Hi,

    how about tags, please (i already see it in code, probably missing some getters)? Anyway, this looks like super useful module... I'm just working on carousel / gallery on top of this module and tags are last missing function...



    Posted by Pali, 2 years ago @paliondras

  • Hi Julian

    What reactivity

    Many thanks

    Posted by jpalsu, 2 years ago

  • Hi Jpalsu,
    I've added a new static method that you can use to add whatever additional extensions you want. Add this line in your mysite/_config.php file:


    Posted by Julian Seidenberg, 2 years ago @candidasa4

  • Hi

    all seems great.

    Can you add the ".flac" files (Free Lossless Audio Codec) in the allowed extensions ?


    Posted by jpalsu, 2 years ago

  • Hey, some good news: I mentioned above that we were working on a method of versioning files in the DMS, right? Well, we've just finished implementing that!

    Here is the commit:

    Please tell us how you like the file versioning implementation.

    Posted by Julian Seidenberg, 2 years ago @candidasa4

  • Wow, thanks everyone for your suggestions and encouragement. I'm blown away by all the positive feedback.

    Let me try and address some of your suggestions:

    Uncle Cheese and Vicky: we hear you about the lack of a gallery view. A lot of us want to see a gallery view, both for the DMS and for the regular Assets area. We are trying to fit that in with all the other important things we are working on. So, it's definitely coming sometime, but, sadly, I can't say when.

    Mick: signing documents in and out is a great idea, but not something for the core module, as it is a very specific use-case. I've written a brief description of how to do this in the following forum thread:
    If anyone wants to create this as a plug-in module to the DMS, please go ahead and we'll list it in the readme.

    Nobrainer Web: sounds like it is time to upgrade your project to SS3 :). Yeah, I know that isn't really possible in all situations, unfortunately. But perhaps the DMS is something that can help you justify upgrading.

    Matty: Composer.json is there now :)

    g4b0: we already have some lightweight permission system built-in. Take a look at:
    That ensures that if the the user doesn't have CanView permissions on a Page, they can't download the Documents added on that page.

    Adam: good point about the DMS UI not necessarily being appropriate for all page types. Check out the new options in the _config.php file:
    I think these do exactly what you need.

    Posted by Julian Seidenberg, 2 years ago @candidasa4

  • Great stuff. Glad to see the DOM legacy lives on!

    The biggest limitation I see is one imposed by GridField, as I understand it, and that is the lack of a gallery view. "16.jpg" is not very useful information at all. We really need images to be first-class citizens.

    DOM also used a different paradigm in which it managed file-containing DataObjects, as opposed to a direct relation to the File class. This allowed the customization of any metadata without having to decorate the File object, e.g. adding fields like Category, Description, RelatedThing, etc. That allowed each page to have its own brand of related resources without globally mutating the core File class.

    Congrats on the release. Anxious to see how this baby progresses in the thriving SS3 ecosystem.

    Posted by Uncle Cheese, 2 years ago @unclecheese

  • A big issue I see here is that most clients have no idea what their documents/files names are. And to not be able to view thumbnails of files that are images is a problem. Is this something you are working on? I'd love to know.

    Posted by vicky smith, 2 years ago

  • As ever excellent work, this was definitely an gap that needed filling. For me i need to make this manageable from the front end but the one thing i would like is the ability to sign out and sign in a document, for when changes are being made to a core document for instance.
    Once again excellent work.


    Posted by Mick Desmond, 2 years ago @searchdogred

  • this is great news, i have been using a similar approach since day 1 on silverstripe 3. for both images and files (using 2 multiuploadfields and some relations) so you can have a file repository on the complete site and per page and image galleries per page in a really easy way. i think that this module will at least replace my current DocumentsRepoHolder page.

    congrats and thanks for sharing!

    Posted by francisco, 2 years ago @dospuntocero

RSS feed for comments on this page | RSS feed for all comments

Want to know more about the company that brought you SilverStripe? Then check out

Comments on this website? Please give feedback.