I just wanted to post a little bit about a project that I will be working on in the coming weeks. My business partner Greg Smart and I were talking the other day about document management inside of MODx and sorting by timestamp. Now, if you are unfamiliar w/ MODx, you should check it out, it’s an enterprise level content management solution that is extremely robust in all that it will do. Greg was asking me if I would be interested in tag teaming the documentMan snippet code to sort by timestamp.
The vast majority of my CMS projects are built around WordPress so I haven’t spent near as much time inside of the MODx Framework as Greg has so the project naturally peaked my interest and I am going to be spending some time in the next few weeks leading up to the holidays looking into the possibilities of making this happen not only to provide some extra functionality to our existing MODx clients but also to give back to the MODx community should we happen upon something viable that works. Of course any research, trial and error that we come across during the course of this project will be documented here as well as on Greg’s blog, www.gregorysmart.com. Below is Greg’s latest blog posts regarding the Document Management project:
In a previous post related to a MODx and jQuery photo gallery solution I had described the creations of a MODx snippet to dynamically return the contents of a given directory. As I had suspected in my previous post this solution works well with other document types and, with a few tweaks, is currently being utilized to return unordered lists of documents on some of our larger websites.
The Why: We have many instances in which our end users maintain lists of documents on their sites. This may be a list of meeting minutes, newsletters or even a list of images that may be styled into a photo gallery presentation. While the TinyMCE plugin does a good enough job allowing for content updating and list creation, we felt we could provide a faster, simpler user experience. Now, with the documentMan snippet, the only action needed is to upload the newest document into the appropriate directory and the unordered list is populated instantly with the new document.
The How: In order to take advantage of this functionality you will need to download the documentMan snippet code. Use this code to create a new snippet in MODx. Inside the document there is a example call that will look like [!documentMan? &Location=`FileName` &docSort=`sort`!].
The “Location” variable is intended to describe the directory inside of assets/files in which you would like to return the list of documents. The snippet code can be changed easily enough if you need it to return from the images directory instead of the files directory.
The “docSort” variable can be set to “sort” or “rsort” depending on how you would like your list ordered. You can use “sort” for alphanumeric sorting or “rsort” for reverse alphanumeric sorting. We figured with some consistent naming the list order could be controlled easily enough. I anticipate at some point we will write the code that will allow for items to be sorted by timestamp, but that will be added to our to do list at this stage of the game.
What Else?: As we have been working on this code it has occurred to us that while this is a quick and simple solution, in many instances more may be needed. What we are envisioning is developing a MODx module that will serve as a document filter. This would allow for files to not only be uploaded into the system, but would allow for file naming, tagging, and categorization while being found in the site search. Some of our initial steps in this direction have been promising and we look forward to providing each of these solutions back to the MODx community.
documentMan, MODx Document Management Snippet | Greg Smart
Questions or Comments?