-
☆ A M B ☆
- 24,524 Posts
After learning from Jared Loman Creative (now there’s another great designer, it’s sheer pleasure to work with him on the sites he’s designed) to think a bit further outside the box than I usually do, I’ve taken Jot in a slightly different directions.
For simple lists such as FAQs, employee bios, restaurant menus, anything where using resources and Ditto would just be overkill, but you still need some kind of input/management system, Jot works great. With just a couple niggly little shortcomings.
So I hacked Jot a little bit (is a little bit hacked anything like a little bit pregnant?) to add a couple of missing features.
I added two fields to the main jot_content table, ’category’ and ’position’.
Let’s take ’category’ first. In a way, you can use the existing Jot tagid parameter to act as a category, but this totally separates items from each other. You can never mix-and-match items from these tagid categorizations. With this additional ’category’ field, and some additions to the core code, you can filter for one or multiple categories. With a select drop-down for categories in the form, you can assign a category to an item, so you only need the one Notes snippet call to create new items for all categories. And with the new &category=`cat1,cat2,cat3` parameter you can retrieve them easily.
The ’position’ field was added so that you can use javascript drag-and-drop positioning scripts with Notes. I originally used a custom field for this, but custom fields are always stored as a string, which makes sorting by it when the value is a number problematic. 11 will come before 2 in such a case, unless you use convoluted queries to force the value into an integer. It was a lot easier to just add an integer field to the jot_content table. The ’parent’ field can be used in Jot, since it’s not used for anything (I presume it was originally intended to allow threaded comments, but I’ve been there, done that, and know how quickly the complications of that mushroom into unmanageable proportions!) but a proper, specific field is a better way to deal with it.
So, I’ve been using it quite happily for some time now, and thought it best to share it here first, so whoever is interested can beat on it and get back to me with whatever they find wrong or whatever other features they think should be added.
As for instructions, it’s Jot. Nothing at all about the functionality of Jot has been changed. Only the two new features have been added.
There is a How-to text file included with code for adding a javascript drag/drop positioning script, as well as how to add an image browser/upload/insert into the form. With this, adding one of the myriad jquery galleries would make a very simple image management feature.
Sounds cool. How is it supposed to be used? As a kind of frontend content management? So priviliged web users can submit/edit/sort content that is displayed in lists?
-
☆ A M B ☆
- 24,524 Posts
It’s used EXACTLY like Jot (except for the category and position additions). Privileged web users can use it, or just logged-in Manager users. You need to specify a web group for editing permissions just to keep it from offering the form to everybody, but the web group you specify doesn’t have to really exist if you’re having manager users use it.
Another way to use it would be to have an unpublished page for Managers to access with the form and the entire list, then on public pages call the snippet with the action property set to `comments` and filtered by category as desired.
*bump*
I’ve used the code as it was provided. I’d really like to have the image posting working but it isn’t happening and I’ve spent (literally) days searching the forums trying to find alternative solutions. If anyone has this working could you provide some pointers about what I should look at changing to get it working.
Many thanks!
-
MODX Staff
- 12,272 Posts
Can’t believe I missed this earlier Susan; very cool and thanks for sharing. Would make for a great FAQ manager with a few tweaks.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me