Ditto pages on the MODx Wiki updated for v2.1

12 Jul 2009 MODx

Some time ago I got myself a login to edit the MODx wiki, but so far I've restricted myself to minor edits to clarify existing material. Today I decided to update the Ditto category with the full list of parameters and placeholders for Ditto 2.1, since the existing pages were still stuck in the Ditto 1.x era.

The exercise provided several challenges - not least, how on Earth to create a new page? It isn't obvious (well, not to me, at any rate), and the MODx wiki help didn't help, but after looking at the Wikipedia help pages I worked it out. You try to go to the page you want to create, and you are offered the chance to create it. Likewise, if you link to a non-existent page in your article, you can click the link in the preview or the published article, and again you have the chance to create the page.

I wanted to transfer the relevant information from the Pogwatch pages to the wiki. This meant changing lots of formatting and layout codes. Fortunately, the material is held in a custom database table, which is listed out for the page in definition lists using the LoopDbChunk snippet and some template chunks. It took only a little experimentation to produce a modified wrapper snippet, template chunks and custom LoopDbChunk function to reproduce the information in the format the wiki uses.

The actual layout was a compromise - I really liked the way the definitions came out in shaded boxes when entered with a space at the start of the line, but after some research I found out you can't set the PRE tags that are behind this to use word-wrapping, so the longer lines are effectively lost off to the right of the page. I had to go back to using colons to produce definition lists. That does the wrap, and I updated my LoopDbChunk function to add bold codes around the labels (Purpose, Values, Default and Notes) to provide some visual stepping stones.

The result was, I think, neat enough, and I hope others find it useful. Once I (or another editor) have added some explanatory text to the articles, it could well be time to update the main category page to match the current Ditto version, and archive the outdated pages.


Comments (0)

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.