Hello
I might need to set up a glossary for e.g. financial terms for a client of mine - I was wondering whether anybody has done something like this and what the best way would be to do this?
any input is appreciated.
thank you
-
MODX Staff
- 2,502 Posts
How big will it be? If it is small you could just use documents and ditto to display them.
If it is large I’d use a custom table and use a document and a snippet to output the data.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
might be an alternative - is this used in conjunction with Ditto? how do I need to setup the glossary - like a glossary folder and documents per letter or per term.
couldn’t find any instructions yet.
I built and a to z port using Ditto. I can clean it up and post it for you.
No, separate from Ditto. I’d create a document/folder for the glossary and use this as the startID for the snippet. Create a child doc for each letter of the alphabet and put all the terms for each letter as the page content. You can then output the [*content*] in the template chunk.
Here ya go. Not exactly ready for the public but it is not too complicated. Some of the options are hard codded (to fit my specific requirements) but I am sure you can understand it by looking at the code. There is basically one part that displays the letters with links and another part that runs ditto using a filter to get the results.
In this version there are only links on the letters that have results, if no results then no active link on the letter.
We can work on getting this ready for the masses mostly by adding some documentation.
I use it like [!ditto_a2z!]] and code the options in the snippet but you can set the tpl and parent in the call as well [!ditto_a2z? &parent=`123` &tpl=`someChunk`!]. I think that I even added pagination but not sure.
It is mostly ditto in a wrapper snippet.
great, I’ll give it a go - how do I need to set up the document - one per term or one document per letter?